From 18817dacd0549423789aa4dc6ad04a98a2e700e4 Mon Sep 17 00:00:00 2001 From: Thierry Carré Date: Tue, 14 Feb 2012 16:32:05 +0100 Subject: cesar: redefine many size about ethernet packet, closes #2900 - Add the difference between a packet tagged or not (simple vlan). - Check the length of the last mme of vs_get_pb_stats.cnf (#2900). - Split in 2 fields the vlan_tag in cp_mme_peer, useful for new macro. - Write the HPAV_MTYPE_MME in little endian, and so remove many swap16. This commit prepare the work to do for #2894 (strongly linked) --- cesar/cp/mme.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'cesar/cp/mme.h') diff --git a/cesar/cp/mme.h b/cesar/cp/mme.h index b8af81153c..9536a7e0dd 100644 --- a/cesar/cp/mme.h +++ b/cesar/cp/mme.h @@ -358,8 +358,10 @@ struct cp_mme_peer_t { /** Peer MAC address. */ mac_t mac; - /** VLAN tag or 0 if none. */ - u32 vlan_tag; + /* First Ethernet type found at offset ETH_TYPE_OFFSET */ + u16 eth_type; + /* 0 if the eth_type isn't a vlan */ + u16 vlan_tci; /** Peer TEI, or 0xff if not TEI based. */ cp_tei_t tei; }; @@ -461,11 +463,13 @@ typedef struct cp_mme_tx_t cp_mme_tx_t; /** Construct a cp_mme_peer_t for unicast to all STA. */ #define CP_MME_PEER_ALL_STA \ - ((cp_mme_peer_t) { .mac = MAC_BROADCAST, .tei = MAC_TEI_MULTI_UNICAST }) + ((cp_mme_peer_t) { .mac = MAC_BROADCAST, .eth_type = HPAV_MTYPE_MME, \ + .tei = MAC_TEI_MULTI_UNICAST }) /** Construct a cp_mme_peer_t from a MAC address and a TEI. */ #define CP_MME_PEER(mac_, tei_) \ - ((cp_mme_peer_t) { .mac = mac_, .vlan_tag = 0, .tei = tei_ }) + ((cp_mme_peer_t) { .mac = mac_, .eth_type = HPAV_MTYPE_MME, \ + .vlan_tci = 0, .tei = tei_ }) /** * Compare two cp_mme_peer_t. -- cgit v1.2.3