blob: cf3d18e88517929477868cda8cb891c8a70939f0 [file] [log] [blame]
#include <stdio.h>
#include <ctype.h>
struct stat_read_buf {
char *buf;
int size;
};
#define STAT_LINEBUF_LEN 200
enum STAT_RET_ERROR {
STAT_READ_OK = 0,
STAT_READ_ERR = 0X01,
STAT_NO_MEM_ERR = 0x02,
STAT_PARSE_ERR = 0x03,
STAT_PARAM_ERR = 0x04,
};
#define UEVENT_BUFFER_SIZE 256
/*======================================
read USB Clients's MAC from this file
======================================*/
#define USB_CLIENT_MAC_FILE "sys/class/android_usb/android0/hostEthaddr"
/*======================================
read USB Clients's State from this file
======================================*/
#define USB_CLIENT_STATE_FILE "sys/class/android_usb/android0/state"
char *stat_get_filename(const char *path);
int stat_commit_file();
int stat_get_line(FILE * file, struct stat_read_buf *read_buf);
int isdigit_dot_colon(char in_char);
char *find_none_white_space(char *instr);
char *find_last_digit(char *instr);
char *find_last_digit_dot_colon(char *instr);
int convert_ip_str_to_ascii(char *in_str, unsigned char *out_str);
int convert_ip_asc_to_str(unsigned char *in_str, char *out_str);
int convert_MAC_str_to_ascii(char *in_str, unsigned char *out_str);
int convert_MAC_asc_to_str(unsigned char *in_str, char *out_str);
int is_Feb_29(int year);
int is_mon_31(int mon);
int stat_init_socket(const char *name);
char *find_last_none_white_space(char *instr);
int stat_system(const char *cmd);
int stat_init_uevent_sock(void);
char *search_key(const char *searchkey, char *buf, size_t buflen);
char* get_file_data(const char *filename);
void traffic_service_log_test(void);