2006-08-08 12:33:33 +00:00
|
|
|
/*
|
2012-07-19 18:11:40 +00:00
|
|
|
* Copyright 2006-2012 Haiku, Inc. All Rights Reserved.
|
2006-08-08 12:33:33 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
2002-07-09 12:24:59 +00:00
|
|
|
*/
|
2006-08-08 12:33:33 +00:00
|
|
|
#ifndef _NET_IF_DL_H
|
|
|
|
#define _NET_IF_DL_H
|
2002-07-09 12:24:59 +00:00
|
|
|
|
|
|
|
|
2006-08-08 12:33:33 +00:00
|
|
|
#include <stdint.h>
|
2002-10-25 15:13:00 +00:00
|
|
|
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2006-08-08 12:33:33 +00:00
|
|
|
/* Link level sockaddr structure */
|
2002-07-09 12:24:59 +00:00
|
|
|
struct sockaddr_dl {
|
2006-08-08 12:33:33 +00: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-20 22:21:36 +00:00
|
|
|
uint8_t sdl_data[20]; /* minimum work area, can be larger */
|
2002-07-09 12:24:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Macro to get a pointer to the link level address */
|
2007-03-20 22:21:36 +00:00
|
|
|
#define LLADDR(s) ((uint8_t *)((s)->sdl_data + (s)->sdl_nlen))
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2006-08-08 12:33:33 +00:00
|
|
|
#endif /* _NET_IF_DL_H */
|