xref: /haiku/headers/posix/net/if_dl.h (revision f7c507c3a6fbf3a44c59500543926a9088724968)
1 /*
2  * Copyright 2006-2018 Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _NET_IF_DL_H
6 #define _NET_IF_DL_H
7 
8 
9 #include <stdint.h>
10 
11 
12 /* Link level sockaddr structure */
13 struct sockaddr_dl {
14 	uint8_t		sdl_len;		/* Total length of sockaddr */
15 	uint8_t		sdl_family;		/* AF_LINK */
16 	uint16_t	sdl_e_type;		/* link level frame type */
17 	uint32_t	sdl_index;		/* index for interface */
18 	uint8_t		sdl_type;		/* interface type */
19 	uint8_t		sdl_nlen;		/* interface name length (not terminated with a null byte) */
20 	uint8_t		sdl_alen;		/* link level address length */
21 	uint8_t		sdl_slen;		/* link layer selector length */
22 	uint8_t		sdl_data[46];	/* minimum work area, can be larger */
23 };
24 
25 /* Macro to get a pointer to the link level address */
26 #define LLADDR(s)	((uint8_t *)((s)->sdl_data + (s)->sdl_nlen))
27 
28 #endif	/* _NET_IF_DL_H */
29