/* pushes hdr onto the skb. fields of hdr->fc that can be calculated from * the contents of hdr will be, and the actual value of those bits in * hdr->fc will be ignored. this includes the INTRA_PAN bit and the frame * version, if SECEN is set.
*/ int ieee802154_hdr_push(struct sk_buff *skb, struct ieee802154_hdr *hdr);
/* pulls the entire 802.15.4 header off of the skb, including the security * header, and performs pan id decompression
*/ int ieee802154_hdr_pull(struct sk_buff *skb, struct ieee802154_hdr *hdr);
/* parses the frame control, sequence number of address fields in a given skb * and stores them into hdr, performing pan id decompression and length checks * to be suitable for use in header_ops.parse
*/ int ieee802154_hdr_peek_addrs(conststruct sk_buff *skb, struct ieee802154_hdr *hdr);
/* parses the full 802.15.4 header a given skb and stores them into hdr, * performing pan id decompression and length checks to be suitable for use in * header_ops.parse
*/ int ieee802154_hdr_peek(conststruct sk_buff *skb, struct ieee802154_hdr *hdr);
/* pushes/pulls various frame types into/from an skb */ int ieee802154_beacon_push(struct sk_buff *skb, struct ieee802154_beacon_frame *beacon); int ieee802154_mac_cmd_push(struct sk_buff *skb, void *frame, constvoid *pl, unsignedint pl_len); int ieee802154_mac_cmd_pl_pull(struct sk_buff *skb, struct ieee802154_mac_cmd_pl *mac_pl);
int ieee802154_max_payload(conststruct ieee802154_hdr *hdr);
staticinlineint
ieee802154_sechdr_authtag_len(conststruct ieee802154_sechdr *sec)
{ switch (sec->level) { case IEEE802154_SCF_SECLEVEL_MIC32: case IEEE802154_SCF_SECLEVEL_ENC_MIC32: return 4; case IEEE802154_SCF_SECLEVEL_MIC64: case IEEE802154_SCF_SECLEVEL_ENC_MIC64: return 8; case IEEE802154_SCF_SECLEVEL_MIC128: case IEEE802154_SCF_SECLEVEL_ENC_MIC128: return 16; case IEEE802154_SCF_SECLEVEL_NONE: case IEEE802154_SCF_SECLEVEL_ENC: default: return 0;
}
}
staticinlineint ieee802154_hdr_length(struct sk_buff *skb)
{ struct ieee802154_hdr hdr; int len = ieee802154_hdr_pull(skb, &hdr);
staticinlineint
ieee802154_sockaddr_check_size(struct sockaddr_ieee802154 *daddr, int len)
{ struct ieee802154_addr_sa *sa; int ret = 0;
sa = &daddr->addr; if (len < IEEE802154_MIN_NAMELEN) return -EINVAL; switch (sa->addr_type) { case IEEE802154_ADDR_NONE: break; case IEEE802154_ADDR_SHORT: if (len < IEEE802154_NAMELEN_SHORT)
ret = -EINVAL; break; case IEEE802154_ADDR_LONG: if (len < IEEE802154_NAMELEN_LONG)
ret = -EINVAL; break; default:
ret = -EINVAL; break;
} return ret;
}
struct ieee802154_llsec_ops { int (*get_params)(struct net_device *dev, struct ieee802154_llsec_params *params); int (*set_params)(struct net_device *dev, conststruct ieee802154_llsec_params *params, int changed);
int (*add_key)(struct net_device *dev, conststruct ieee802154_llsec_key_id *id, conststruct ieee802154_llsec_key *key); int (*del_key)(struct net_device *dev, conststruct ieee802154_llsec_key_id *id);
int (*add_dev)(struct net_device *dev, conststruct ieee802154_llsec_device *llsec_dev); int (*del_dev)(struct net_device *dev, __le64 dev_addr);
int (*add_devkey)(struct net_device *dev,
__le64 device_addr, conststruct ieee802154_llsec_device_key *key); int (*del_devkey)(struct net_device *dev,
__le64 device_addr, conststruct ieee802154_llsec_device_key *key);
int (*add_seclevel)(struct net_device *dev, conststruct ieee802154_llsec_seclevel *sl); int (*del_seclevel)(struct net_device *dev, conststruct ieee802154_llsec_seclevel *sl);
void (*lock_table)(struct net_device *dev); void (*get_table)(struct net_device *dev, struct ieee802154_llsec_table **t); void (*unlock_table)(struct net_device *dev);
}; /* * This should be located at net_device->ml_priv * * get_phy should increment the reference counting on returned phy. * Use wpan_wpy_put to put that reference.
*/ struct ieee802154_mlme_ops { /* The following fields are optional (can be NULL). */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.