summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorOlivier Dufour2013-03-15 11:12:25 +0100
committerOlivier Dufour2013-03-21 11:20:16 +0100
commitad3d5f114952492e5ea68f19e5e34cfaabecb04d (patch)
tree3ba8d2b34b9dd55b648515e4b456ffe04fa380fb /common
parent8cdcbf05fabf797231f98c2224b6ee6f299fca91 (diff)
common/lib/scammer: add CC_DISCOVER_LIST in scammer, refs #3843
Diffstat (limited to 'common')
-rw-r--r--common/lib/scammer/cc.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/common/lib/scammer/cc.py b/common/lib/scammer/cc.py
index a5936de884..1332426f26 100644
--- a/common/lib/scammer/cc.py
+++ b/common/lib/scammer/cc.py
@@ -182,6 +182,64 @@ class CC_ASSOC_CNF (MMEPayload):
LEShortField ("tei_lease", 0),
]
+class CC_DISCOVER_LIST_REQ (MMEPayload):
+ """Handles the CC_DISCOVER_LIST.REQ MME."""
+ name = "HomePlug AV CC_DISCOVER_LIST.REQ"
+ fields_desc = [
+ ]
+
+class CC_DISCOVER_LIST_CNF_stations (Packet):
+ """Handle a CC_DISCOVER_LIST.CNF StationInfo entry."""
+ name = "HomePlug AV CC_DISCOVER_LIST.CNF StationInfo entry"
+ fields_desc = [
+ MACField ("mac", 0),
+ ByteField ("tei", 0),
+ ByteField ("same_network", 0),
+ ByteField ("snid", 0),
+ BitField ("reserved", 0, 1),
+ BitField ("cco_cap", 0, 2),
+ BitField ("pco_cap", 0, 1),
+ BitField ("bcco_cap", 0, 1),
+ BitField ("cco_status", 0, 1),
+ BitField ("pco_status", 0, 1),
+ BitField ("bcco_status", 0, 1),
+ ByteField ("signal_level", 0),
+ ByteField ("average_ble", 0),
+ ]
+
+ def extract_padding(self, s):
+ return "", s
+
+class CC_DISCOVER_LIST_CNF_networks (Packet):
+ """Handle a CC_DISCOVER_LIST.CNF NetworkInfo entry."""
+ name = "HomePlug AV CC_DISCOVER_LIST.CNF NetworkInfo entry"
+ fields_desc = [
+ HPAVNIDField ("nid", 0),
+ ByteField ("snid", 0),
+ ByteField ("hm", 0),
+ ByteField ("num_slots", 0),
+ ByteField ("coordinating_status", 0),
+ ShortField ("offset", 0),
+ ]
+
+ def extract_padding(self, s):
+ return "", s
+
+class CC_DISCOVER_LIST_CNF (MMEPayload):
+ """Handles the CC_DISCOVER_LIST.CNF MME."""
+ name = "HomePlug AV CC_DISCOVER_LIST.CNF"
+ fields_desc = [
+ FieldLenField ("num_station", None, count_of="stations", fmt="B"),
+ PacketListField ("stations", None, CC_DISCOVER_LIST_CNF_stations,
+ count_from = lambda p: p.num_station),
+ FieldLenField ("num_network", None, count_of="networks", fmt="B"),
+ PacketListField ("networks", None, CC_DISCOVER_LIST_CNF_networks,
+ count_from = lambda p: p.num_network),
+ ]
+
+ def extract_padding(self, s):
+ return "", s
+
if __name__ == '__main__':
m = CC_WHO_RU_REQ (nid = 0x03c3ffdd7d22d5)
hexdump (str (m))