15adca30aSAxel Dörfler /* 2*e4104854SAugustin Cavalier * Copyright 2006-2018 Haiku, Inc. All Rights Reserved. 35adca30aSAxel Dörfler * Distributed under the terms of the MIT License. 452a38012Sejakowatz */ 55adca30aSAxel Dörfler #ifndef _NET_IF_DL_H 65adca30aSAxel Dörfler #define _NET_IF_DL_H 752a38012Sejakowatz 852a38012Sejakowatz 95adca30aSAxel Dörfler #include <stdint.h> 1015750026Sbeveloper 1152a38012Sejakowatz 125adca30aSAxel Dörfler /* Link level sockaddr structure */ 1352a38012Sejakowatz struct sockaddr_dl { 145adca30aSAxel Dörfler uint8_t sdl_len; /* Total length of sockaddr */ 155adca30aSAxel Dörfler uint8_t sdl_family; /* AF_LINK */ 165adca30aSAxel Dörfler uint16_t sdl_e_type; /* link level frame type */ 175adca30aSAxel Dörfler uint32_t sdl_index; /* index for interface */ 185adca30aSAxel Dörfler uint8_t sdl_type; /* interface type */ 195adca30aSAxel Dörfler uint8_t sdl_nlen; /* interface name length (not terminated with a null byte) */ 205adca30aSAxel Dörfler uint8_t sdl_alen; /* link level address length */ 215adca30aSAxel Dörfler uint8_t sdl_slen; /* link layer selector length */ 22*e4104854SAugustin Cavalier uint8_t sdl_data[46]; /* minimum work area, can be larger */ 2352a38012Sejakowatz }; 2452a38012Sejakowatz 2552a38012Sejakowatz /* Macro to get a pointer to the link level address */ 26bdfc47dbSAxel Dörfler #define LLADDR(s) ((uint8_t *)((s)->sdl_data + (s)->sdl_nlen)) 2752a38012Sejakowatz 285adca30aSAxel Dörfler #endif /* _NET_IF_DL_H */ 29