Page MenuHomec4science

hybridMAC.h
No OneTemporary

File Metadata

Created
Sat, Jul 5, 07:54

hybridMAC.h

#ifndef CLICKNET_HYBRIDMAC_H
#define CLICKNET_HYBRIDMAC_H
// The control/probe packets used for the hybrid communications MAC sublayer, use the MAC CONTROL Ethertype protocol. (#define ETHERTYPE_MACCONTROL 0x8808 in ether.h)
// In order to determine whether a power-line or wireless link is available to a specific destination, the source sends an availability request (AVREQ), and if the destination receives it, it responds with an availability reply (AVREP)
#define ETHER_MACCTL_OP_AVREQ 0x0002
#define ETHER_MACCTL_OP_AVREP 0x0003
// the Plc interface sends a statistics request (STREQ) which driggers the destination to count how many messages it receives from this source and send a statistics reply after 100ms (STREP)
#define ETHER_MACCTL_OP_STREQ 0x0004
#define ETHER_MACCTL_OP_STREP 0x0005
// the following type of messages are used as packet pairs or packet trains to estimate the available bandwidth between 2 stations
#define ETHER_MACCTL_OP_BWEST 0x0006
#define ETHERTYPE_HP_AV 0x88e1
#define NW_STATS_REQ 0x4860
#define TONE_MAP_REQ 0x70a0
#define HP_AV_VERSION 0x01
#define NW_STATS_REP 0x4960
#define TONE_MAP_REP 0x71a0
#define SNIFFER_IND 0x36a0
#define HPAV_MMTYPE_SNIFFER_REQ 0xA034
#define HPAV_SC_DISABLE 0x00
#define HPAV_SC_ENABLE 0x01
struct click_hp_av_header {
uint8_t version;
uint16_t MMType;
uint16_t fmi;
} CLICK_SIZE_PACKED_ATTRIBUTE;
/// Tone Maps Structures for REQ and REP as well as useful stuff
struct click_hp_av_tone_map_req {
uint8_t version;
uint16_t MMType;
uint8_t oui[3];
uint8_t macaddr[6]; // MAC Address of the neighbour that we want to know the tonemap for
uint8_t tmslot; // Timeslot
} CLICK_SIZE_PACKED_ATTRIBUTE;
struct carrier {
u_int8_t mod_carrier_lo:4;
u_int8_t mod_carrier_hi:4;
} CLICK_SIZE_PACKED_ATTRIBUTE;
struct click_hp_av_tone_map_rep {
uint8_t version;
uint16_t MMType;
uint8_t oui[3];
uint8_t mstatus;
uint8_t tmslot;
uint8_t num_tms;
uint16_t tm_num_act_carrier;
struct carrier carriers[0];
} CLICK_SIZE_PACKED_ATTRIBUTE;
enum mod_carrier {
NO = 0x0,
BPSK = 0x1,
QPSK = 0x2,
QAM_8 = 0x3,
QAM_16 = 0x4,
QAM_64 = 0x5,
QAM_256 = 0x6,
QAM_1024 = 0x7,
};
struct modulation_stats {
uint16_t no;
uint16_t bpsk;
uint16_t qpsk;
uint16_t qam8;
uint16_t qam16;
uint16_t qam64;
uint16_t qam256;
uint16_t qam1024;
uint16_t unknown;
};
////////////////////////////////////////
/// Structures for sniffer frames ///
struct click_hp_av_fc {
u_int8_t del_type:3;
u_int8_t access:1;
u_int8_t snid:4;
u_int8_t stei;
u_int8_t dtei;
u_int8_t lid;
u_int8_t cfs:1;
u_int8_t bdf:1;
u_int8_t hp10df:1;
u_int8_t hp11df:1;
u_int8_t eks:4;
u_int8_t ppb;
u_int8_t ble;
u_int8_t pbsz:1;
u_int8_t num_sym:2;
u_int8_t tmi_av:5;
u_int16_t fl_av:12;
u_int8_t mpdu_cnt:2;
u_int8_t burst_cnt:2;
u_int8_t clst:3;
u_int8_t rg_len:6;
u_int8_t mfs_cmd_mgmt:3;
u_int8_t mfs_cmd_data:3;
u_int8_t rsr:1;
u_int8_t mcf:1;
u_int8_t dccpcf:1;
u_int8_t mnbf:1;
u_int8_t rsvd:5;
u_int8_t fccs_av[3];
} CLICK_SIZE_PACKED_ATTRIBUTE;
struct click_hp_av_bcn {
u_int8_t del_type:3;
u_int8_t access:1;
u_int8_t snid:4;
u_int32_t bts;
u_int16_t bto_0;
u_int16_t bto_1;
u_int16_t bto_2;
u_int16_t bto_3;
u_int8_t fccs_av[3];
} CLICK_SIZE_PACKED_ATTRIBUTE;
struct click_hp_av_sniffer_indicate {
uint8_t version;
uint16_t MMType;
uint8_t oui[3];
u_int8_t type;
u_int8_t direction;
u_int64_t systime;
u_int32_t beacontime;
struct click_hp_av_fc fc;
struct click_hp_av_bcn bcn;
} CLICK_SIZE_PACKED_ATTRIBUTE;
struct click_sniffer_request {
uint8_t version;
uint16_t MMType;
uint8_t oui[3];
u_int8_t control;
u_int8_t reserved1[4];
} CLICK_SIZE_PACKED_ATTRIBUTE;
/////////////////////////////////
struct cm_sta_info {
uint8_t DA[6];
uint8_t AvgPHYDR_TX;
uint8_t AvgPHYDR_RX;
};
struct cm_sta_infos {
uint8_t NumSTAs;
struct cm_sta_info infos[0];
};
struct click_hp_av_nw_stats_conf {
struct cm_sta_infos sta;
} CLICK_SIZE_PACKED_ATTRIBUTE;
// definitions and headers for broadcast packets that estimate loss rate
#define IP_PROTO_BROADCAST_PACKET 80
struct click_broadcast_packet_header {
uint32_t identification;
} CLICK_SIZE_PACKED_ATTRIBUTE;
#endif

Event Timeline