2006-08-08 16:33:33 +04:00
|
|
|
/*
|
2010-11-04 00:46:47 +03:00
|
|
|
* Copyright 2006-2010 Haiku Inc. All Rights Reserved.
|
2006-08-08 16:33:33 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
2002-07-09 16:24:59 +04:00
|
|
|
*/
|
2006-08-08 16:33:33 +04:00
|
|
|
#ifndef _NET_IF_DL_H
|
|
|
|
#define _NET_IF_DL_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
2006-08-08 16:33:33 +04:00
|
|
|
#include <stdint.h>
|
2002-10-25 19:13:00 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2006-08-08 16:33:33 +04:00
|
|
|
/* Link level sockaddr structure */
|
2002-07-09 16:24:59 +04:00
|
|
|
struct sockaddr_dl {
|
2006-08-08 16:33:33 +04:00
|
|
|
uint8_t sdl_len; /* Total length of sockaddr */
|
|
|
|
uint8_t sdl_family; /* AF_LINK */
|
|
|
|
uint16_t sdl_e_type; /* link level frame type */
|
|
|
|
uint32_t sdl_index; /* index for interface */
|
|
|
|
uint8_t sdl_type; /* interface type */
|
|
|
|
uint8_t sdl_nlen; /* interface name length (not terminated with a null byte) */
|
|
|
|
uint8_t sdl_alen; /* link level address length */
|
|
|
|
uint8_t sdl_slen; /* link layer selector length */
|
2007-03-21 01:21:36 +03:00
|
|
|
uint8_t sdl_data[20]; /* minimum work area, can be larger */
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Macro to get a pointer to the link level address */
|
2007-03-21 01:21:36 +03:00
|
|
|
#define LLADDR(s) ((uint8_t *)((s)->sdl_data + (s)->sdl_nlen))
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2006-08-08 16:33:33 +04:00
|
|
|
#endif /* _NET_IF_DL_H */
|