blob: 8e50907f373552043017bcaaaf7ab96f4b8028d2 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 *
3 * Copyright (C) 2023
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
14 *
15 * FileName : zlog_com.h
16 * This program Capture module's trace log.
17 */
18
19#ifndef __ZLOG_COM_H__
20#define __ZLOG_COM_H__
21
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25#include <fcntl.h>
26#include <unistd.h>
27#include <syslog.h>
28#include <signal.h>
29#include <errno.h>
30#include <sys/time.h>
31#include <sys/types.h>
32#include <sys/socket.h>
33#include <netinet/in.h>
34#include <netdb.h>
35
36/**
37 * Íⲿº¯ÊýÉùÃ÷
38 */
39extern int set_tty(int fd,char *settings);
40
41/**
42 * ºê¶¨Òå
43 */
44#define ZLOG_DEFAULT_TTYBAUD "921600 raw"
45
46#define PRINTF_DBG_INFO(fmt, args...) \
47 do \
48 { \
49 printf("INFO:%s(%d)-%s:\n"fmt":\n", __FILE__,__LINE__,__FUNCTION__); \
50 } while (0)
51
52#define PRINTF_DBG_ERROR(fmt, args...) \
53 do \
54 { \
55 printf("ERROR:%s(line %d)--%s: "fmt": %s\n", __FILE__,__LINE__,__FUNCTION__,##args, strerror(errno)); \
56 } while (0)
57
58#define dbg_time(fmt, args...) \
59 do { \
60 fprintf(stdout, "[%s-%d] " fmt, __func__, __LINE__, ##args); \
61 fflush(stdout); \
62 } while (0)
63
64typedef unsigned long UINT32;
65typedef unsigned long ULONG32;
66
67/**
68 * ½á¹¹Ì嶨Òå
69 */
70typedef struct
71{
72 UINT32 curfd;
73 UINT32 uFileNum;
74 UINT32 uFileSize;
75 UINT32 tmaxLogNum;
76 ULONG32 tMaxLogsize;
77 char *localFsPath;
78}T_COMM_FS_PARAM;
79
80#endif
81
82