Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" {
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h> /* get local ip */
#include <net/if.h> /* get local ip */
#include <linux/if.h> /* get local ip */
#include <linux/if_packet.h>
#include </usr/include/linux/filter.h>
//#include "../../uClibc-0.9.28/_install/usr/arm-linux-uclibc/usr/include/linux/filter.h"
Expand All @@ -57,7 +57,6 @@ extern "C" {
//#include "/uClibc-0.9.28/include/pthread.h"
#include <pthread.h>

typedef unsigned char BOOL;
typedef short STATUS;
typedef int (*FUNCPTR)(void); //return int
typedef unsigned char (*U8FUNCPTR)(void); //return U8
Expand Down Expand Up @@ -112,7 +111,7 @@ typedef int tIPC_ID;
typedef enum {
FALSE,
TRUE
} L7_BOOL;
}tBOOL;

// abi, modified, 20070412
//typedef unsigned long U64; /* = ULONG in VxWorks */
Expand Down
2 changes: 1 addition & 1 deletion ip_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#define ICMP_UNREACHABLE 0x3
#define ICMP_ECHO_REQUEST 0x8

enum {
typedef enum {
ICMP_NETWORK_UNREACHABLE = 0,
ICMP_HOST_UNREACHABLE = 1,
ICMP_PROTOCOL_UNREACHABLE = 2,
Expand Down
2 changes: 1 addition & 1 deletion ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void house_keep();
void PRINT_IPC_TBL(tIPC_TBL *ipc_tbl);

tIPC_ID ipc_tbl_msgid=-1;
BOOL alarm_flag;
tBOOL alarm_flag;

/*-----------------------------------------
* hk_exit :
Expand Down
4 changes: 2 additions & 2 deletions ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" { /* in .cpp file, only this line is enough */

#define IPC_DEF_QID 0

enum {
typedef enum {
IPC_EV_TYPE_DEF,
IPC_EV_TYPE_WEB,
IPC_EV_TYPE_CLI,
Expand All @@ -38,7 +38,7 @@ typedef struct {
key_t key;
char name[80];
int type;
BOOL valid;
tBOOL valid;
} tIPC_TBL;

typedef struct {
Expand Down
4 changes: 2 additions & 2 deletions os_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ void OSTMR_StopXtmr(void *ccb, U16 event)
* event - timeout event
* return : TRUE/FALSE
**********************************************************************/
BOOL OSTMR_IsTmrListEmpty()
tBOOL OSTMR_IsTmrListEmpty()
{
if (tmrObj.shm->tmrHdr == NULL)
return TRUE;
Expand All @@ -598,7 +598,7 @@ BOOL OSTMR_IsTmrListEmpty()
* event - timeout event
* return : TRUE/FALSE
**********************************************************************/
BOOL OSTMR_IsTmrExist(void *ccb, U16 event)
tBOOL OSTMR_IsTmrExist(void *ccb, U16 event)
{
pTMR_CB cur;

Expand Down
6 changes: 3 additions & 3 deletions os_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct _TMR_CB {
void *ccb;
tIPC_ID Que; /* It is a pointer */
pTMR_CB next;
BOOL idle;
tBOOL idle;
};

typedef struct _TMR_CBs tTMR_CBs;
Expand Down Expand Up @@ -70,7 +70,7 @@ extern void OSTMR_FreeTmrCb(pTMR_CB p);
extern void OSTMR_StartTmr(tIPC_ID Que, void *ccb, U32 delay, char *name, U16 event);
extern void OSTMR_StopTmrs(void *ccb);
extern void OSTMR_StopXtmr(void *ccb, U16 event);
extern BOOL OSTMR_IsTmrListEmpty(void);
extern BOOL OSTMR_IsTmrExist(void *ccb, U16 event);
extern tBOOL OSTMR_IsTmrListEmpty(void);
extern tBOOL OSTMR_IsTmrExist(void *ccb, U16 event);

#endif /* _OS_TIMER_H_ */
6 changes: 3 additions & 3 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ int get_local_mac(U8 *mac, char *sif)
return -1;
}

strncpy(sifreq.ifr_name, sif, IF_NAMESIZE-1);
strncpy(sifreq.ifr_name, sif, IFNAMSIZ-1);
if (ioctl(fd, SIOCGIFHWADDR, &sifreq) != 0){
printf("error! ioctl failed when getting mac\n");
close(fd);
Expand Down Expand Up @@ -330,7 +330,7 @@ int get_local_ip(U8 *ip_str, char *sif)
return -1;
}

strncpy(ifr.ifr_name, sif, IF_NAMESIZE-1);
strncpy(ifr.ifr_name, sif, IFNAMSIZ-1);
if (ioctl(fd, SIOCGIFADDR, &ifr) < 0) {
perror("ioctl SIOCGIFADDR error");
return -1;
Expand Down Expand Up @@ -366,7 +366,7 @@ int set_local_ip(char *ip_str, char *sif)
bzero(&mask,sizeof(mask));

//sprintf(ifr.ifr_name, sif);
strncpy(ifr.ifr_name, sif, IF_NAMESIZE-1);
strncpy(ifr.ifr_name, sif, IFNAMSIZ-1);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr(ip_str);
//printf("addr.sin_addr.s_addr=%x\n",addr.sin_addr.s_addr);
Expand Down