IBR-DTNSuite  0.10
ieee802154.h
Go to the documentation of this file.
1 /*
2  * IEEE802.15.4-2003 implementation user-space header.
3  *
4  * Copyright (C) 2008, 2009 Siemens AG
5  *
6  * Written-by: Dmitry Eremin-Solenikov
7  * Written-by: Sergey Lapin
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #ifndef __IEEE802154_H
25 #define __IEEE802154_H
26 
27 #ifdef HAVE_NET_IEEE802154_H
28 #include <net/ieee802154.h>
29 #endif
30 #ifdef HAVE_NET_AF_IEEE802154_H
31 #include <net/af_ieee802154.h>
32 #endif
33 
34 #ifndef IEEE802154_ADDR_LEN
35 #define IEEE802154_ADDR_LEN 8
36 #endif
37 
38 #include <sys/socket.h>
39 #include <stdint.h>
40 #ifndef HAVE_STRUCT_SOCKADDR_IEEE802154
41 
42 enum {
44  // RESERVER = 0x01,
45  IEEE802154_ADDR_SHORT = 0x2, /* 16-bit address + PANid */
46  IEEE802154_ADDR_LONG = 0x3 /* 64-bit address + PANid */
47 };
48 
50  int addr_type;
51  uint16_t pan_id;
52  union {
54  uint16_t short_addr;
55  };
56 };
57 
59  sa_family_t family; /* AF_IEEE802154 */
61 };
62 #endif
63 
64 #ifndef N_IEEE802154
65 #define N_IEEE802154 19
66 #endif
67 
68 #ifndef PF_IEEE802154
69 #define PF_IEEE802154 36
70 #define AF_IEEE802154 PF_IEEE802154
71 #endif
72 
73 #include <net/if_arp.h>
74 #ifndef ARPHRD_IEEE802154
75 #define ARPHRD_IEEE802154 804
76 #define ARPHRD_IEEE802154_PHY 805
77 #endif
78 
79 #ifndef IEEE802154_MAC_SCAN_ED
80 #define IEEE802154_MAC_SCAN_ED 0x0
81 #define IEEE802154_MAC_SCAN_ACTIVE 0x1
82 #define IEEE802154_MAC_SCAN_PASSIVE 0x2
83 #define IEEE802154_MAC_SCAN_ORPHAN 0x3
84 #endif
85 
86 #include <linux/if_ether.h>
87 #ifndef ETH_P_IEEE802154
88 #define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */
89 #endif
90 
91 /* get/setsockopt */
92 #ifndef SOL_IEEE802154
93 #define SOL_IEEE802154 0
94 #endif
95 
96 #ifndef WPAN_WANTACK
97 #define WPAN_WANTACK 0
98 #endif
99 
100 
101 #endif