#ifndef _INTE4_H #define _INTE4_H #define NIPQUAD(addr) \ ((unsigned char *)&addr)[0], \ ((unsigned char *)&addr)[1], \ ((unsigned char *)&addr)[2], \ ((unsigned char *)&addr)[3] #define MAC(hwaddr) \ ((unsigned char *)&hwaddr)[0], \ ((unsigned char *)&hwaddr)[1], \ ((unsigned char *)&hwaddr)[2], \ ((unsigned char *)&hwaddr)[3], \ ((unsigned char *)&hwaddr)[4], \ ((unsigned char *)&hwaddr)[5] int ipv4_get_addr (const char *interface, char *ip, int *family); int ipv4_get_broad (const char *interface, char *ip, int *family); int ipv4_get_dest (const char *interface, char *ip, int *family); int ipv4_get_mask (const char *interface, char *ip, int *family); int ipv4_get_hwaddr(const char *ifname, char *mac, int *family); int ipv4_set_addr (const char *interface, const char *ip, int family); int ipv4_set_broad (const char *interface, const char *ip, int family); int ipv4_set_dest (const char *interface, const char *ip, int family); int ipv4_set_mask (const char *interface, const char *ip, int family); int ipv4_set_hwaddr(const char *ifname, const char *mac, int family); /* set ifname up/down state 1/0 */ int ipv4_set_up(const char *ifname, unsigned int state); int ipv4_get_up(const char *ifname); /* numbers -gt 255 are truncated ( 256=>0 ; 257=>1 ) */ unsigned int ipv4_scan(const char *s,char *ip); #endif