1+ RTR Serial Notify 2 3= default instantiation 4 5pkt = IP()/TCP(dport=323)/RTRSerialNotify() 6raw(pkt) == b'E\x00\x004\x00\x01\x00\x00@\x06|\xc1\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x90q\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00' 7 8= default values build 9 10pkt = IP()/TCP(dport=323)/RTRSerialNotify() 11RTRSerialNotify in pkt and pkt.rtr_version == 0 and pkt.pdu_type == 0 and pkt.session_id == 0 and pkt.length == 12 and pkt.serial_number == 0 12 13 14= filled values build 15 16pkt = IP()/TCP(dport=323)/RTRSerialNotify(session_id=12345, length=12, serial_number=789) 17raw(pkt) == b'E\x00\x004\x00\x01\x00\x00@\x06|\xc1\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00]#\x00\x00\x00\x0009\x00\x00\x00\x0c\x00\x00\x03\x15' 18 19= dissection 20 21pkt = Ether(b'\x00\x16>\xa9\x04\x1a\x84x\xac[\x82\xc2\x08\x00E\x00\x16\xd4\xb9\xa5@\x005\x06\x93\xd5\x8d\x16\x1c\xdc\xb9\x1a~\x9c Z\xcb\xa2\nF2`J\xe2\x8c\xc0\x80\x10\x00\xe3\xf8o\x00\x00\x01\x01\x08\n\xeaX\x9f\x82\x81\xfb\xc4\n\x00\x00\x00\x00\x00\x00\xcc!\x00\x04\x00\x00') 22pkt.session_id == 0 and pkt.length == 52257 and pkt.serial_number == 262144 23 24+ RTR Serial Query 25 26= default instantiation 27 28pkt = IP()/TCP(dport=323)/RTRSerialQuery() 29raw(pkt) == b'E\x00\x004\x00\x01\x00\x00@\x06|\xc1\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x90p\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00' 30 31 32= default values build 33 34pkt = IP()/TCP(dport=323)/RTRSerialQuery() 35RTRSerialQuery in pkt and pkt.rtr_version == 0 and pkt.pdu_type == 1 and pkt.session_id == 0 and pkt.length == 12 and pkt.serial_number == 0 36 37 38= filled values build 39 40pkt = IP()/TCP(dport=323)/RTRSerialQuery(session_id=17, length=12, serial_number=55463) 41raw(pkt) == b'E\x00\x004\x00\x01\x00\x00@\x06|\xc1\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\xb7\xb7\x00\x00\x00\x01\x00\x11\x00\x00\x00\x0c\x00\x00\xd8\xa7' 42 43= dissection 44 45pkt = Ether(b'\x00\x07\xb4\x00+\x02\x00\x16>\xa9\x04\x1a\x08\x00E\x00\x00@I2@\x00@\x06\x0f\xdd\xb9\x1a~\x9c\x8d\x16\x1c\xdc\xcb\xa2 ZJ\xe2\x8c\xc0\nR\xdbD\x80\x18\x05#\xe1\xdb\x00\x00\x01\x01\x08\n\x81\xfb\xcf\xca\xeaX\xcd\x92\x00\x01\x13/\x00\x00\x00\x0c\x00\x00\x81\x7f') 46pkt.session_id == 4911 and pkt.length == 12 and pkt.serial_number == 33151 47 48+ RTR Reset Query 49 50= default instantiation 51 52pkt = IP()/TCP(dport=323)/RTRResetQuery() 53raw(pkt) == b'E\x00\x000\x00\x01\x00\x00@\x06|\xc5\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x90w\x00\x00\x00\x02\x00\x00\x00\x00\x00\x08' 54 55= default values build 56 57pkt = IP()/TCP(dport=323)/RTRResetQuery() 58RTRResetQuery in pkt and pkt.reserved == 0 and pkt.length == 8 59 60#= filled values build - nonsense test 61 62= dissection 63 64pkt = Ether(b"\x00\x07\xb4\x00+\x02\x00\x16>\xa9\x04\x1a\x08\x00E\x00\x00<H\xb8@\x00@\x06\x10[\xb9\x1a~\x9c\x8d\x16\x1c\xdc\xcb\xa2 ZJ\xe2\x8c\xb8\nF'\x10\x80\x18\x00\xe5\xe1\xd7\x00\x00\x01\x01\x08\n\x81\xfb\xc4\n\xeaX\x9e\x91\x00\x02\x00\x00\x00\x00\x00\x08") 65pkt.reserved == 0 and pkt.length == 8 66 67+ RTR Cache Response 68 69= default instantiation 70 71pkt = IP()/TCP(dport=323)/RTRCacheResponse() 72raw(pkt) == b'E\x00\x000\x00\x01\x00\x00@\x06|\xc5\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x90v\x00\x00\x00\x03\x00\x00\x00\x00\x00\x08' 73 74= default values build 75 76pkt = IP()/TCP(dport=323)/RTRCacheResponse() 77RTRCacheResponse in pkt and pkt.session_id == 0 and pkt.length == 8 78 79= filled values build 80 81pkt = IP()/TCP(dport=323)/RTRCacheResponse(session_id=12345) 82raw(pkt) == b'E\x00\x000\x00\x01\x00\x00@\x06|\xc5\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00`=\x00\x00\x00\x0309\x00\x00\x00\x08' 83 84= dissection 85 86pkt = Ether(b"\x00\x16>\xa9\x04\x1a\x84x\xac[\x82\xc2\x08\x00E\x00\x0b\x84\xb9\xa3@\x005\x06\x9f'\x8d\x16\x1c\xdc\xb9\x1a~\x9c Z\xcb\xa2\nF'\x10J\xe2\x8c\xc0\x80\x10\x00\xe3\xed\x1f\x00\x00\x01\x01\x08\n\xeaX\x9f\x82\x81\xfb\xc4\n\x00\x03\x13/\x00\x00\x00\x08") 87pkt.session_id == 4911 and pkt.length == 8 88 89+ RTR IPv4 Prefix 90 91= default instantiation 92 93pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTRIPv4Prefix() 94raw(pkt) == b'E\x00\x00D\x00\x01\x00\x00@\x06|\xb1\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x90J\x00\x00\x00\x03\x00\x00\x00\x00\x00\x08\x00\x04\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 95 96= default values build 97 98pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTRIPv4Prefix() 99RTRIPv4Prefix in pkt and pkt.shortest_length == 0 and pkt.longest_length == 0 and pkt.prefix == "0.0.0.0" and pkt.asn == 0 100 101= filled values build 102 103pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTRIPv4Prefix(prefix="192.0.2.0", asn=45000, shortest_length=20, longest_length=20) 104raw(pkt) == b'E\x00\x00D\x00\x01\x00\x00@\x06|\xb1\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\nm\x00\x00\x00\x03\x00\x00\x00\x00\x00\x08\x00\x04\x00\x00\x00\x00\x00\x14\x00\x14\x14\x00\xc0\x00\x02\x00\x00\x00\xaf\xc8' 105 106= dissection 107 108pkt = Ether(b"\x00\x16>\xa9\x04\x1a\x84x\xac[\x82\xc2\x08\x00E\x00\x0b\x84\xb9\xa3@\x005\x06\x9f'\x8d\x16\x1c\xdc\xb9\x1a~\x9c Z\xcb\xa2\nF'\x10J\xe2\x8c\xc0\x80\x10\x00\xe3\xed\x1f\x00\x00\x01\x01\x08\n\xeaX\x9f\x82\x81\xfb\xc4\n\x00\x03\x13/\x00\x00\x00\x08\x00\x04\x00\x00\x00\x00\x00\x14\x01\x13\x13\x00Y\xb9\xe0\x00\x00\x00a\x8b") 109pkt.asn == 24971 and pkt.prefix == "89.185.224.0"and pkt.shortest_length == 19 and pkt.longest_length == 19 110 111 112+ RTR IPv6 Prefix 113 114= default instantiation 115 116pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTRIPv6Prefix() 117raw(pkt) == b'E\x00\x00P\x00\x01\x00\x00@\x06|\xa5\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x900\x00\x00\x00\x03\x00\x00\x00\x00\x00\x08\x00\x06\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 118 119= default value build 120 121pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTRIPv6Prefix() 122RTRIPv6Prefix in pkt and pkt.shortest_length == 0 and pkt.longest_length == 0 and pkt.prefix == "::" and pkt.asn == 0 123 124= filled values build 125 126pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTRIPv6Prefix(prefix="2001:db8::", asn=45000, shortest_length=32, longest_length=32) 127pkt.prefix == "2001:db8::" and pkt.asn == 45000 and pkt.shortest_length == 32 and pkt.longest_length == 32 128 129= dissection 130 131pkt = Ether(b"\x00\x16>\xa9\x04\x1a\x84x\xac[\x82\xc2\x08\x00E\x00\x0b\x84\xb9\xa3@\x005\x06\x9f'\x8d\x16\x1c\xdc\xb9\x1a~\x9c Z\xcb\xa2\nF'\x10J\xe2\x8c\xc0\x80\x10\x00\xe3\xed\x1f\x00\x00\x01\x01\x08\n\xeaX\x9f\x82\x81\xfb\xc4\n\x00\x03\x13/\x00\x00\x00\x08\x00\x06\x00\x00\x00\x00\x00 \x01 \x00*\x03\xcd\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xe2") 132pkt.prefix == "2a03:cd80::" and pkt.asn == 16354 and pkt.shortest_length == 32 and pkt.longest_length == 32 133 134+ RTR End of Data version 0 135 136= default instantiation 137 138pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTREndofDatav0() 139raw(pkt) == b'E\x00\x00<\x00\x01\x00\x00@\x06|\xb9\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x90W\x00\x00\x00\x03\x00\x00\x00\x00\x00\x08\x00\x07\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00' 140 141= default values build 142 143pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTREndofDatav0() 144RTREndofDatav0 in pkt and pkt.session_id == 0 and pkt.serial_number == 0 145 146= filled values build 147 148pkt = IP()/TCP(dport=323)/RTRCacheResponse(session_id=12345)/RTREndofDatav0(session_id=12345, serial_number=17) 149pkt.serial_number == 17 and pkt.session_id == 12345 150 151= dissection 152 153pkt = IP(b'E\x00\x00<\x00\x01\x00\x00@\x06|\xb9\x7f\x00\x00\x01\x7f\x00\x00\x01 Z\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x0f\x8e\x00\x00\x00\x0309\x00\x00\x00\x08\x00\x0709\x00\x00\x00\x0c\x00\x00\x00\x11') 154RTREndofDatav0 in pkt and pkt.serial_number == 17 and pkt.session_id == 12345 155 156+ RTR End of Data version 1 157 158= default instantiation 159 160pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTREndofDatav1() 161raw(pkt) == b'E\x00\x00H\x00\x01\x00\x00@\x06|\xad\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x8f?\x00\x00\x00\x03\x00\x00\x00\x00\x00\x08\x01\x07\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 162 163= default values build 164 165pkt = IP()/TCP(dport=323)/RTRCacheResponse()/RTREndofDatav1() 166RTREndofDatav1 in pkt and pkt.session_id == 0 and pkt.serial_number == 0 and pkt.refresh_interval == 0 and pkt.retry_interval == 0 and pkt.expire_interval == 0 167 168= filled values build 169 170pkt = IP()/TCP(dport=323)/RTRCacheResponse(session_id=12345)/RTREndofDatav1(session_id=12345, serial_number=17, refresh_interval=500 , retry_interval=200, expire_interval=1800) 171pkt.serial_number == 17 and pkt.session_id == 12345 172 173= dissection 174 175pkt = IP(b'E\x00\x00H\x00\x01\x00\x00@\x06|\xad\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00$\xf8\x00\x00\x00\x0309\x00\x00\x00\x08\x01\x0709\x00\x00\x00\x18\x00\x00\x00\x11\x00\x00\x01\xf4\x00\x00\x00\xc8\x00\x00\x07\x08') 176RTREndofDatav1 in pkt and pkt.serial_number == 17 and pkt.session_id == 12345 177 178+ RTR Cache Reset 179 180= default instantiation 181 182pkt = IP()/TCP(dport=323)/RTRCacheReset() 183raw(pkt) == b'E\x00\x000\x00\x01\x00\x00@\x06|\xc5\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x90q\x00\x00\x00\x08\x00\x00\x00\x00\x00\x08' 184 185= default values build 186 187pkt = IP()/TCP(dport=323)/RTRCacheReset() 188RTRCacheReset in pkt and pkt.reserved == 0 189 190#= filled values build - nonsense test 191 192= dissection 193 194pkt = Ether(b'\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x08\x00E\x00\x000\x00\x01\x00\x00@\x06|\xc5\x7f\x00\x00\x01\x7f\x00\x00\x01 Z\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00p+\x00\x00\x00\x08\x00\x00\x00\x00\x00\x08') 195RTRCacheReset in pkt and pkt.reserved == 0 196 197+ RTR Router Key 198 199= default instantiation 200 201pkt = IP()/TCP(dport=323)/RTRRouterKey() 202raw(pkt) == b'E\x00\x00H\x00\x01\x00\x00@\x06|\xad\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x8f>\x00\x00\x01\t\x00\x00\x00"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 203 204= default values build 205 206pkt = IP()/TCP(dport=323)/RTRRouterKey() 207RTRRouterKey in pkt and pkt.zeros == 0 and pkt.subject_key_identifier == b'' and pkt.asn == 0 and pkt.subject_PKI == b'' 208 209= filled values build 210 211pkt = IP()/TCP(dport=323)/RTRRouterKey(subject_key_identifier='7dd65f58882efc148edd', asn=45000, subject_PKI='Scapy ROA') 212pkt.asn == 45000 and pkt.subject_PKI == b'Scapy ROA' and pkt.subject_key_identifier == b'7dd65f58882efc148edd' 213 214= dissection 215pkt = IP(b'E\x00\x00Q\x00\x01\x00\x00@\x06|\xa4\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00x\xe8\x00\x00\x01\t\x00\x00\x00+\x00\x007dd65f58882efc148edd\x00\x00\xaf\xc8Scapy ROA') 216RTRRouterKey in pkt #and pkt.asn == 45000 and pkt.subject_PKI == b'Scapy ROA' and pkt.zeros == 0 and pkt.subject_key_identifier == b'7dd65f58882efc148edd' 217 218+ RTR Error Report 219 220= default instantiation 221 222pkt = IP()/TCP(dport=323)/RTRErrorReport() 223raw(pkt) == b'E\x00\x008\x00\x01\x00\x00@\x06|\xbd\x7f\x00\x00\x01\x7f\x00\x00\x01\x00\x14\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\x90]\x00\x00\x00\n\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' 224 225= default values build 226 227pkt = IP()/TCP(dport=323)/RTRErrorReport() 228RTRErrorReport in pkt and pkt.error_code == 0 and pkt.erroneous_PDU == b'' and pkt.error_text == b'' 229 230= filled values build 231 232pkt = IP()/TCP(dport=323)/RTRErrorReport(error_code=1, error_text='Internal Error') 233RTRErrorReport in pkt and pkt.error_code == 1 and pkt.error_text == b'Internal Error' 234 235= dissection 236 237pkt = IP(b'E\x00\x00F\x00\x01\x00\x00@\x06|\xaf\x7f\x00\x00\x01\x7f\x00\x00\x01 Z\x01C\x00\x00\x00\x00\x00\x00\x00\x00P\x02 \x00\xdc\x15\x00\x00\x00\n\x00\x01\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x0eInternal Error') 238RTRErrorReport in pkt and pkt.error_code == 1 and pkt.error_text == b'Internal Error' 239