#ifndef __API_H__
#define __API_H__

#ifndef OK
#define OK (0)
#endif

#ifndef ERROR
#define ERROR (-1)
#endif

#ifndef RAW_PACKET_LEN_MAX
#define RAW_PACKET_LEN_MAX 1514
#endif

#ifndef RAW_PACKET_LEN_MIN
#define RAW_PACKET_LEN_MIN 14
#endif

#ifndef ETH_P_TP
#define ETH_P_TP 0x8110
#endif

typedef struct ether_addr ETH_ADDR;
typedef struct ether_header ETH_HEADER;

#ifndef BROADCAST_MAC_ADDR
#define BROADCAST_MAC_ADDR "FF:FF:FF:FF:FF:FF"
#endif

#define MAC_HEX_LEN 6
#ifndef STR_MAC_LEN
#define STR_MAC_LEN 18	
#endif
size_t strlcpy(char *dest, const char *src, size_t dest_size);
int mac_hex2mac_string(char *mac_hex, char *mac_str);
int mac_string2mac_hex(char *mac_str, char *mac_hex);
int get_local_macaddr(char *dev_name, char *mac_str);
unsigned char csum(unsigned char *addr, int count);
#endif