1 /* if.h 2 * Interface definitions for beos 3 */ 4 5 #ifndef OBOS_IF_DL_H 6 #define OBOS_IF_DL_H 7 8 #include <net/if.h> 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 /* link level sockaddr structure */ 15 struct sockaddr_dl { 16 uint8 sdl_len; /* Total length of sockaddr */ 17 uint8 sdl_family; /* AF_LINK */ 18 uint16 sdl_index; /* if != 0, system given index for interface */ 19 uint8 sdl_type; /* interface type */ 20 uint8 sdl_nlen; /* interface name length, no trailing 0 reqd. */ 21 uint8 sdl_alen; /* link level address length */ 22 uint8 sdl_slen; /* link layer selector length */ 23 char sdl_data[24]; /* minimum work area, can be larger; 24 contains both if name and ll address */ 25 }; 26 27 /* Macro to get a pointer to the link level address */ 28 #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) 29 30 void link_addr (const char *, struct sockaddr_dl *); 31 char *link_ntoa (const struct sockaddr_dl *); 32 33 #ifdef __cplusplus 34 } 35 #endif 36 37 #endif /* OBOS_IF_DL_H */ 38 39