2019-05-27 13:55:21 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2009-06-08 19:18:48 +07:00
|
|
|
/*
|
2015-09-03 21:31:35 +07:00
|
|
|
* IEEE 802.15.4 interface for userspace
|
2009-06-08 19:18:48 +07:00
|
|
|
*
|
|
|
|
* Copyright 2007, 2008 Siemens AG
|
|
|
|
*
|
|
|
|
* Written by:
|
|
|
|
* Sergey Lapin <slapin@ossfans.org>
|
|
|
|
* Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _AF_IEEE802154_H
|
|
|
|
#define _AF_IEEE802154_H
|
|
|
|
|
|
|
|
#include <linux/socket.h> /* for sa_family_t */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
IEEE802154_ADDR_NONE = 0x0,
|
|
|
|
/* RESERVED = 0x01, */
|
|
|
|
IEEE802154_ADDR_SHORT = 0x2, /* 16-bit address + PANid */
|
|
|
|
IEEE802154_ADDR_LONG = 0x3, /* 64-bit address + PANid */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* address length, octets */
|
|
|
|
#define IEEE802154_ADDR_LEN 8
|
|
|
|
|
2014-03-15 03:23:57 +07:00
|
|
|
struct ieee802154_addr_sa {
|
2009-06-08 19:18:48 +07:00
|
|
|
int addr_type;
|
|
|
|
u16 pan_id;
|
|
|
|
union {
|
|
|
|
u8 hwaddr[IEEE802154_ADDR_LEN];
|
|
|
|
u16 short_addr;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#define IEEE802154_PANID_BROADCAST 0xffff
|
|
|
|
#define IEEE802154_ADDR_BROADCAST 0xffff
|
|
|
|
#define IEEE802154_ADDR_UNDEF 0xfffe
|
|
|
|
|
|
|
|
struct sockaddr_ieee802154 {
|
|
|
|
sa_family_t family; /* AF_IEEE802154 */
|
2014-03-15 03:23:57 +07:00
|
|
|
struct ieee802154_addr_sa addr;
|
2009-06-08 19:18:48 +07:00
|
|
|
};
|
|
|
|
|
2009-08-07 09:58:43 +07:00
|
|
|
/* get/setsockopt */
|
|
|
|
#define SOL_IEEE802154 0
|
|
|
|
|
2014-05-16 22:46:41 +07:00
|
|
|
#define WPAN_WANTACK 0
|
|
|
|
#define WPAN_SECURITY 1
|
|
|
|
#define WPAN_SECURITY_LEVEL 2
|
2018-06-07 21:08:02 +07:00
|
|
|
#define WPAN_WANTLQI 3
|
2014-05-16 22:46:41 +07:00
|
|
|
|
|
|
|
#define WPAN_SECURITY_DEFAULT 0
|
|
|
|
#define WPAN_SECURITY_OFF 1
|
|
|
|
#define WPAN_SECURITY_ON 2
|
|
|
|
|
|
|
|
#define WPAN_SECURITY_LEVEL_DEFAULT (-1)
|
2009-08-07 09:58:43 +07:00
|
|
|
|
2009-06-08 19:18:48 +07:00
|
|
|
#endif
|