Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * IEEE 802.15.4 interface for userspace
0004  *
0005  * Copyright 2007, 2008 Siemens AG
0006  *
0007  * Written by:
0008  * Sergey Lapin <slapin@ossfans.org>
0009  * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
0010  */
0011 
0012 #ifndef _AF_IEEE802154_H
0013 #define _AF_IEEE802154_H
0014 
0015 #include <linux/socket.h> /* for sa_family_t */
0016 
0017 enum {
0018     IEEE802154_ADDR_NONE = 0x0,
0019     /* RESERVED = 0x01, */
0020     IEEE802154_ADDR_SHORT = 0x2, /* 16-bit address + PANid */
0021     IEEE802154_ADDR_LONG = 0x3, /* 64-bit address + PANid */
0022 };
0023 
0024 /* address length, octets */
0025 #define IEEE802154_ADDR_LEN 8
0026 
0027 struct ieee802154_addr_sa {
0028     int addr_type;
0029     u16 pan_id;
0030     union {
0031         u8 hwaddr[IEEE802154_ADDR_LEN];
0032         u16 short_addr;
0033     };
0034 };
0035 
0036 #define IEEE802154_PANID_BROADCAST  0xffff
0037 #define IEEE802154_ADDR_BROADCAST   0xffff
0038 #define IEEE802154_ADDR_UNDEF       0xfffe
0039 
0040 struct sockaddr_ieee802154 {
0041     sa_family_t family; /* AF_IEEE802154 */
0042     struct ieee802154_addr_sa addr;
0043 };
0044 
0045 /* get/setsockopt */
0046 #define SOL_IEEE802154  0
0047 
0048 #define WPAN_WANTACK        0
0049 #define WPAN_SECURITY       1
0050 #define WPAN_SECURITY_LEVEL 2
0051 #define WPAN_WANTLQI        3
0052 
0053 #define WPAN_SECURITY_DEFAULT   0
0054 #define WPAN_SECURITY_OFF   1
0055 #define WPAN_SECURITY_ON    2
0056 
0057 #define WPAN_SECURITY_LEVEL_DEFAULT (-1)
0058 
0059 #endif