3 extern int diag_led(int type
, int act
);
4 extern int C_led(int i
);
5 extern int get_single_ip(char *ipaddr
, int which
);
6 extern char *get_mac_from_ip(char *ip
);
7 extern struct dns_lists
*get_dns_list(int no
);
8 extern int dns_to_resolv(void);
9 extern char *get_wan_face(void);
10 extern int check_wan_link(int num
);
11 extern char *get_complete_lan_ip(char *ip
);
12 extern int get_int_len(int num
);
13 extern int file_to_buf(char *path
, char *buf
, int len
);
14 extern int buf_to_file(char *path
, char *buf
);
15 extern pid_t
* find_pid_by_name( char* pidName
);
16 extern int find_pid_by_ps(char* pidName
);
17 extern int *find_all_pid_by_ps(char* pidName
);
18 extern char *find_name_by_proc(int pid
);
19 extern int get_ppp_pid(char *file
);
20 extern long convert_ver(char *ver
);
21 extern int check_flash(void);
22 extern int check_action(void);
23 extern int check_now_boot(void);
24 extern int check_hw_type(void);
25 extern int is_exist(char *filename
);
26 extern void set_ip_forward(char c
);
27 struct mtu_lists
*get_mtu(char *proto
);
28 extern void set_host_domain_name(void);
30 extern void encode(char *buf
, int len
);
31 extern void decode(char *buf
, int len
);
33 extern int sys_netdev_ioctl(int family
, int socket
, char *if_name
, int cmd
, struct ifreq
*ifr
);
35 int ct_openlog(const char *ident
, int option
, int facility
, char *log_name
);
36 void ct_syslog(int level
, int enable
, const char *fmt
,...);
37 void ct_logger(int level
, const char *fmt
,...);
38 struct wl_assoc_mac
* get_wl_assoc_mac(int *c
);
42 enum { DMZ
, SESSION
, DIAG
, WL
};
44 enum { START_LED
, STOP_LED
};
46 typedef enum { ACT_IDLE
,
51 ACT_HW_RESTORE
} ACTION
;
53 enum { UNKNOWN_BOOT
= -1, PMON_BOOT
, CFE_BOOT
};
55 enum { BCM4702_CHIP
, BCM4712_CHIP
, BCM5325E_CHIP
};
57 enum { FIRST
, SECOND
};
59 enum { SYSLOG_LOG
=1, SYSLOG_DEBUG
, CONSOLE_ONLY
, LOG_CONSOLE
, DEBUG_CONSOLE
};
61 #define ACTION(cmd) buf_to_file(ACTION_FILE, cmd)
65 char dns_server
[4][16];
77 char *proto
; /* protocol */
78 char *min
; /* min mtu */
79 char *max
; /* max mtu */
83 #define PPP_PSEUDO_IP "10.64.64.64"
84 #define PPP_PSEUDO_NM "255.255.255.255"
85 #define PPP_PSEUDO_GW "10.112.112.112"
87 #define PING_TMP "/tmp/ping.log"
88 #define TRACEROUTE_TMP "/tmp/traceroute.log"
89 #define MAX_BUF_LEN 254
91 #define RESOLV_FILE "/tmp/resolv.conf"
92 #define HOSTS_FILE "/tmp/hosts"
94 #define LOG_FILE "/var/log/mess"
96 #define ACTION_FILE "/tmp/action"
99 #define split(word, wordlist, next, delim) \
100 for (next = wordlist, \
101 strncpy(word, next, sizeof(word)), \
102 word[(next=strstr(next, delim)) ? strstr(word, delim) - word : sizeof(word) - 1] = '\0', \
103 next = next ? next + sizeof(delim) - 1 : NULL ; \
105 next = next ? : "", \
106 strncpy(word, next, sizeof(word)), \
107 word[(next=strstr(next, delim)) ? strstr(word, delim) - word : sizeof(word) - 1] = '\0', \
108 next = next ? next + sizeof(delim) - 1 : NULL)
110 #define STRUCT_LEN(name) sizeof(name)/sizeof(name[0])
112 #define printHEX(str,len) { \
114 for (i=0 ; i<len ; i++) { \
115 printf("%02X ", (unsigned char)*(str+i)); \
116 if(((i+1)%16) == 0) printf("- "); \
117 if(((i+1)%32) == 0) printf("\n"); \
123 #define printASC(str,len) { \
125 for (i=0 ; i<len ; i++) { \
126 printf("%c", (unsigned char)*(str+i)); \
127 if(((i+1)%16) == 0) printf("- "); \
128 if(((i+1)%32) == 0) printf("\n"); \
This page took 0.044711 seconds and 5 git commands to generate.