IBR-DTNSuite  0.8
ibrcommon/ibrcommon/net/nl_policy.c
Go to the documentation of this file.
00001 /*
00002  * nl802154.h
00003  *
00004  * Copyright (C) 2007, 2008 Siemens AG
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License version 2
00008  * as published by the Free Software Foundation.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License along
00016  * with this program; if not, write to the Free Software Foundation, Inc.,
00017  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018  *
00019  */
00020 
00021 #include <netlink/netlink.h>
00022 #include <netlink/attr.h>
00023 #include "ibrcommon/net/nl802154.h"
00024 
00025 #define NLA_HW_ADDR NLA_U64
00026 
00027 struct nla_policy ieee802154_policy[IEEE802154_ATTR_MAX + 1] = {
00028         [IEEE802154_ATTR_DEV_NAME] = { .type = NLA_STRING, },
00029         [IEEE802154_ATTR_DEV_INDEX] = { .type = NLA_U32, },
00030         [IEEE802154_ATTR_PHY_NAME] = { .type = NLA_STRING, },
00031         [IEEE802154_ATTR_DEV_TYPE] = { .type = NLA_U8, },
00032 
00033         [IEEE802154_ATTR_STATUS] = { .type = NLA_U8, },
00034         [IEEE802154_ATTR_SHORT_ADDR] = { .type = NLA_U16, },
00035         [IEEE802154_ATTR_HW_ADDR] = { .type = NLA_HW_ADDR, },
00036         [IEEE802154_ATTR_PAN_ID] = { .type = NLA_U16, },
00037         [IEEE802154_ATTR_CHANNEL] = { .type = NLA_U8, },
00038         [IEEE802154_ATTR_PAGE] = { .type = NLA_U8, },
00039         [IEEE802154_ATTR_COORD_SHORT_ADDR] = { .type = NLA_U16, },
00040         [IEEE802154_ATTR_COORD_HW_ADDR] = { .type = NLA_HW_ADDR, },
00041         [IEEE802154_ATTR_COORD_PAN_ID] = { .type = NLA_U16, },
00042         [IEEE802154_ATTR_SRC_SHORT_ADDR] = { .type = NLA_U16, },
00043         [IEEE802154_ATTR_SRC_HW_ADDR] = { .type = NLA_HW_ADDR, },
00044         [IEEE802154_ATTR_SRC_PAN_ID] = { .type = NLA_U16, },
00045         [IEEE802154_ATTR_DEST_SHORT_ADDR] = { .type = NLA_U16, },
00046         [IEEE802154_ATTR_DEST_HW_ADDR] = { .type = NLA_HW_ADDR, },
00047         [IEEE802154_ATTR_DEST_PAN_ID] = { .type = NLA_U16, },
00048 
00049         [IEEE802154_ATTR_CAPABILITY] = { .type = NLA_U8, },
00050         [IEEE802154_ATTR_REASON] = { .type = NLA_U8, },
00051         [IEEE802154_ATTR_SCAN_TYPE] = { .type = NLA_U8, },
00052         [IEEE802154_ATTR_CHANNELS] = { .type = NLA_U32, },
00053         [IEEE802154_ATTR_DURATION] = { .type = NLA_U8, },
00054         [IEEE802154_ATTR_ED_LIST] = { .minlen = 27, .maxlen = 27, },
00055         [IEEE802154_ATTR_CHANNEL_PAGE_LIST] = { .minlen = 0, .maxlen = 32 * 4, },
00056 };
00057