2 * Routines for RPKI-Router Protocol dissection (RFC6810)
3 * Copyright 2013, Alexis La Goutte <alexis.lagoutte at gmail dot com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
11 * The information used comes from:
12 * RFC6810: The Resource Public Key Infrastructure (RPKI) to Router Protocol
17 #include <epan/packet.h>
18 #include <epan/prefs.h>
19 #include "packet-tcp.h"
20 #include "packet-tls.h"
21 #include <epan/expert.h>
22 #include <epan/asn1.h>
24 #include <wsutil/array.h>
25 #include "packet-x509af.h"
27 void proto_register_rpkirtr(void);
28 void proto_reg_handoff_rpkirtr(void);
30 static int proto_rpkirtr
;
31 static int hf_rpkirtr_version
;
32 static int hf_rpkirtr_pdu_type
;
33 static int hf_rpkirtr_reserved
;
34 static int hf_rpkirtr_session_id
;
35 static int hf_rpkirtr_length
;
36 static int hf_rpkirtr_serial_number
;
37 static int hf_rpkirtr_flags
;
38 static int hf_rpkirtr_flags_aw
;
39 static int hf_rpkirtr_flags_rk
;
40 static int hf_rpkirtr_flags_ar
;
41 static int hf_rpkirtr_flags_arafi
;
42 static int hf_rpkirtr_prefix_length
;
43 static int hf_rpkirtr_max_length
;
44 static int hf_rpkirtr_ipv4_prefix
;
45 static int hf_rpkirtr_ipv6_prefix
;
46 static int hf_rpkirtr_as_number
;
47 static int hf_rpkirtr_error_code
;
48 static int hf_rpkirtr_length_pdu
;
49 static int hf_rpkirtr_error_pdu
;
50 static int hf_rpkirtr_length_text
;
51 static int hf_rpkirtr_error_text
;
52 static int hf_rpkirtr_refresh_interval
;
53 static int hf_rpkirtr_retry_interval
;
54 static int hf_rpkirtr_expire_interval
;
55 static int hf_rpkirtr_subject_key_identifier
;
56 static int hf_rpkirtr_subject_public_key_info
;
57 static int hf_rpkirtr_aspa_provider_as_count
;
58 static int hf_rpkirtr_aspa_customer_asn
;
59 static int hf_rpkirtr_aspa_provider_asn
;
61 #define RPKI_RTR_TCP_PORT 323
62 #define RPKI_RTR_TLS_PORT 324
63 static unsigned g_port_rpkirtr_tls
= RPKI_RTR_TLS_PORT
;
65 static int ett_rpkirtr
;
67 static int ett_flags_nd
;
68 static int ett_providers
;
70 static expert_field ei_rpkirtr_wrong_version_aspa
;
71 static expert_field ei_rpkirtr_wrong_version_router_key
;
72 static expert_field ei_rpkirtr_bad_length
;
74 static dissector_handle_t rpkirtr_handle
;
77 /* http://www.iana.org/assignments/rpki/rpki.xml#rpki-rtr-pdu */
78 #define RPKI_RTR_SERIAL_NOTIFY_PDU 0
79 #define RPKI_RTR_SERIAL_QUERY_PDU 1
80 #define RPKI_RTR_RESET_QUERY_PDU 2
81 #define RPKI_RTR_CACHE_RESPONSE_PDU 3
82 #define RPKI_RTR_IPV4_PREFIX_PDU 4
83 #define RPKI_RTR_IPV6_PREFIX_PDU 6
84 #define RPKI_RTR_END_OF_DATA_PDU 7
85 #define RPKI_RTR_CACHE_RESET_PDU 8
86 #define RPKI_RTR_ROUTER_KEY 9
87 #define RPKI_RTR_ERROR_REPORT_PDU 10
88 #define RPKI_RTR_ASPA_PDU 11
90 static const value_string rtr_pdu_type_vals
[] = {
91 { RPKI_RTR_SERIAL_NOTIFY_PDU
, "Serial Notify" },
92 { RPKI_RTR_SERIAL_QUERY_PDU
, "Serial Query" },
93 { RPKI_RTR_RESET_QUERY_PDU
, "Reset Query" },
94 { RPKI_RTR_CACHE_RESPONSE_PDU
, "Cache Response" },
95 { RPKI_RTR_IPV4_PREFIX_PDU
, "IPv4 Prefix" },
96 { RPKI_RTR_IPV6_PREFIX_PDU
, "IPv6 Prefix" },
97 { RPKI_RTR_END_OF_DATA_PDU
, "End of Data" },
98 { RPKI_RTR_CACHE_RESET_PDU
, "Cache Reset" },
99 { RPKI_RTR_ROUTER_KEY
, "Router Key" },
100 { RPKI_RTR_ERROR_REPORT_PDU
, "Error Report" },
101 { RPKI_RTR_ASPA_PDU
, "ASPA" },
105 /* http://www.iana.org/assignments/rpki/rpki.xml#rpki-rtr-error */
106 static const value_string rtr_error_code_vals
[] = {
107 { 0, "Corrupt Data" },
108 { 1, "Internal Error" },
109 { 2, "No Data Available" },
110 { 3, "Invalid Request" },
111 { 4, "Unsupported Protocol Version" },
112 { 5, "Unsupported PDU Type" },
113 { 6, "Withdrawal of Unknown Record" },
114 { 7, "Duplicate Announcement Received" },
115 { 8, "Unexpected Protocol Version" },
119 static const true_false_string tfs_flag_type_aw
= {
124 static const true_false_string tfs_flag_type_rk
= {
129 static const true_false_string tfs_flag_type_ar
= {
130 "New Autonomous System Provider Authorization Record",
131 "Delete Autonomous System Provider Authorization Record"
134 static const true_false_string tfs_flag_type_afi_ar
= {
140 get_rpkirtr_pdu_len(packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
, void *data _U_
)
145 * Get the length of the RPKI-RTR packet.
147 plen
= tvb_get_ntohl(tvb
, offset
+4);
153 static int dissect_rpkirtr_pdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
156 proto_item
*ti
= NULL
, *ti_flags
, *ti_type
;
157 proto_tree
*rpkirtr_tree
= NULL
, *flags_tree
= NULL
;
159 uint8_t pdu_type
, version
;
162 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
164 ti
= proto_tree_add_item(tree
, proto_rpkirtr
, tvb
, 0, -1, ENC_NA
);
166 rpkirtr_tree
= proto_item_add_subtree(ti
, ett_rpkirtr
);
168 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
169 version
= tvb_get_uint8(tvb
, offset
);
172 ti_type
= proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_pdu_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
173 pdu_type
= tvb_get_uint8(tvb
, offset
);
174 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, val_to_str(pdu_type
, rtr_pdu_type_vals
, "Unknown (%d)"));
175 proto_item_append_text(ti
, " (%s)", val_to_str(pdu_type
, rtr_pdu_type_vals
, "Unknown %d"));
178 length
= tvb_get_ntohl(tvb
, offset
);
181 case RPKI_RTR_SERIAL_NOTIFY_PDU
: /* Serial Notify (0) */
182 case RPKI_RTR_SERIAL_QUERY_PDU
: /* Serial Query (1) */
183 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_session_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
185 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
186 /* TODO: Add check length ? */
188 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_serial_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
191 case RPKI_RTR_RESET_QUERY_PDU
: /* Reset Query (2) */
192 case RPKI_RTR_CACHE_RESET_PDU
: /* Cache Reset (8) */
193 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_reserved
, tvb
, offset
, 2, ENC_NA
);
195 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
196 /* TODO: Add check length ? */
199 case RPKI_RTR_CACHE_RESPONSE_PDU
: /* Cache Response (3) */
200 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_session_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
202 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
203 /* TODO: Add check length ? */
206 case RPKI_RTR_IPV4_PREFIX_PDU
: /* IPv4 Prefix (4) */
207 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_reserved
, tvb
, offset
, 2, ENC_NA
);
209 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
210 /* TODO: Add check length ? */
212 ti_flags
= proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
213 flags_tree
= proto_item_add_subtree(ti_flags
, ett_flags
);
214 proto_tree_add_item(flags_tree
, hf_rpkirtr_flags_aw
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
216 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_prefix_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
218 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_max_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
220 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_reserved
, tvb
, offset
, 1, ENC_NA
);
222 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_ipv4_prefix
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
224 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_as_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
227 case RPKI_RTR_IPV6_PREFIX_PDU
: /* IPv6 Prefix (6) */
228 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_reserved
, tvb
, offset
, 2, ENC_NA
);
230 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
231 /* TODO: Add check length ? */
233 ti_flags
= proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
234 flags_tree
= proto_item_add_subtree(ti_flags
, ett_flags
);
235 proto_tree_add_item(flags_tree
, hf_rpkirtr_flags_aw
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
237 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_prefix_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
239 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_max_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
241 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_reserved
, tvb
, offset
, 1, ENC_NA
);
243 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_ipv6_prefix
, tvb
, offset
, 16, ENC_NA
);
245 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_as_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
248 case RPKI_RTR_END_OF_DATA_PDU
: /* End Of Data (7) */
249 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_session_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
251 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
252 /* TODO: Add check length ? */
254 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_serial_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
258 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_refresh_interval
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
261 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_retry_interval
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
264 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_expire_interval
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
269 case RPKI_RTR_ROUTER_KEY
: /* Router Key (9) */
271 /* Error about wrong version... */
272 expert_add_info(pinfo
, ti_type
, &ei_rpkirtr_wrong_version_router_key
);
276 ti_flags
= proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
277 flags_tree
= proto_item_add_subtree(ti_flags
, ett_flags_nd
);
278 proto_tree_add_item(flags_tree
, hf_rpkirtr_flags_rk
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
280 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_reserved
, tvb
, offset
, 2, ENC_NA
);
282 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
283 /* TODO: Add check length ? */
285 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_subject_key_identifier
, tvb
, offset
, 20, ENC_NA
);
288 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_as_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
290 asn1_ctx_init(&asn1_ctx
, ASN1_ENC_BER
, true, pinfo
);
291 offset
= dissect_x509af_SubjectPublicKeyInfo(false, tvb
, offset
, &asn1_ctx
, rpkirtr_tree
, hf_rpkirtr_subject_public_key_info
);
295 case RPKI_RTR_ERROR_REPORT_PDU
: /* Error Report (10) */
297 uint32_t len_pdu
, len_text
;
298 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_error_code
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
300 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
301 /* TODO: Add check length ? */
303 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length_pdu
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
304 len_pdu
= tvb_get_ntohl(tvb
, offset
);
306 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_error_pdu
, tvb
, offset
, len_pdu
, ENC_NA
);
308 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length_text
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
309 len_text
= tvb_get_ntohl(tvb
, offset
);
311 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_error_text
, tvb
, offset
, len_text
, ENC_ASCII
);
315 case RPKI_RTR_ASPA_PDU
: /* ASPA (11) */
317 /* Error about wrong version... */
318 expert_add_info(pinfo
, ti_type
, &ei_rpkirtr_wrong_version_aspa
);
320 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_reserved
, tvb
, offset
, 2, ENC_NA
);
322 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
324 ti_flags
= proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
325 flags_tree
= proto_item_add_subtree(ti_flags
, ett_flags_nd
);
326 proto_tree_add_item(flags_tree
, hf_rpkirtr_flags_ar
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
328 ti_flags
= proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_flags
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
329 flags_tree
= proto_item_add_subtree(ti_flags
, ett_flags_nd
);
330 proto_tree_add_item(flags_tree
, hf_rpkirtr_flags_arafi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
334 proto_tree_add_item_ret_uint(rpkirtr_tree
, hf_rpkirtr_aspa_provider_as_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &cnt_asns
);
337 proto_tree_add_item(rpkirtr_tree
, hf_rpkirtr_aspa_customer_asn
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
340 proto_tree
*providers_tree
= proto_item_add_subtree(rpkirtr_tree
, ett_providers
);
341 for (unsigned i
= 0; i
< cnt_asns
; i
++) {
342 proto_tree_add_item(providers_tree
, hf_rpkirtr_aspa_provider_asn
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
348 /* No default ? At least sanity check the length*/
349 if (length
> tvb_reported_length(tvb
)) {
350 expert_add_info(pinfo
, ti_type
, &ei_rpkirtr_bad_length
);
351 return tvb_reported_length(tvb
);
359 return tvb_reported_length(tvb
);
363 dissect_rpkirtr(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
365 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "RPKI-RTR");
366 col_clear(pinfo
->cinfo
, COL_INFO
);
368 tcp_dissect_pdus(tvb
, pinfo
, tree
, 1, 8, get_rpkirtr_pdu_len
, dissect_rpkirtr_pdu
, data
);
369 return tvb_reported_length(tvb
);
373 proto_register_rpkirtr(void)
375 module_t
*rpkirtr_module
;
377 static hf_register_info hf
[] = {
378 { &hf_rpkirtr_version
,
379 { "Version", "rpki-rtr.version",
380 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
381 "Denoting the version of this protocol (currently 0)", HFILL
}
383 { &hf_rpkirtr_pdu_type
,
384 { "PDU Type", "rpki-rtr.pdu_type",
385 FT_UINT8
, BASE_DEC
, VALS(rtr_pdu_type_vals
), 0x0,
386 "Denoting the type of the PDU", HFILL
}
388 { &hf_rpkirtr_reserved
,
389 { "Reserved", "rpki-rtr.reserved",
390 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
391 "Must be zero", HFILL
}
393 { &hf_rpkirtr_session_id
,
394 { "Session ID", "rpki-rtr.session_id",
395 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
398 { &hf_rpkirtr_length
,
399 { "Length", "rpki-rtr.length",
400 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
401 "Value the count of the bytes in the entire PDU, including the eight bytes of header that end with the length field", HFILL
}
403 { &hf_rpkirtr_serial_number
,
404 { "Serial Number", "rpki-rtr.serial_number",
405 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
409 { "Flags", "rpki-rtr.flags",
410 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
413 { &hf_rpkirtr_flags_aw
,
414 { "Flag AW", "rpki-rtr.flags.aw",
415 FT_BOOLEAN
, 8, TFS(&tfs_flag_type_aw
), 0x01,
418 { &hf_rpkirtr_flags_rk
,
419 { "Flag Router Key", "rpki-rtr.flags.rk",
420 FT_BOOLEAN
, 8, TFS(&tfs_flag_type_rk
), 0x01,
423 { &hf_rpkirtr_flags_ar
,
424 { "Flag ASPA", "rpki-rtr.flags.ar",
425 FT_BOOLEAN
, 8, TFS(&tfs_flag_type_ar
), 0x01,
428 { &hf_rpkirtr_flags_arafi
,
429 { "ASPA Address Family Flag", "rpki-rtr.flags.arafi",
430 FT_BOOLEAN
, 8, TFS(&tfs_flag_type_afi_ar
), 0x01,
433 { &hf_rpkirtr_prefix_length
,
434 { "Prefix Length", "rpki-rtr.prefix_length",
435 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
436 "Denoting the shortest prefix allowed for the prefix", HFILL
}
438 { &hf_rpkirtr_max_length
,
439 { "Max length", "rpki-rtr.max_length",
440 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
441 "Denoting the longest prefix allowed by the prefix. This MUST NOT be less than the Prefix Length element", HFILL
}
443 { &hf_rpkirtr_ipv4_prefix
,
444 { "IPv4 Prefix", "rpki-rtr.ipv4_prefix",
445 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
446 "The IPv4 prefix of the ROA", HFILL
}
448 { &hf_rpkirtr_ipv6_prefix
,
449 { "IPv6 Prefix", "rpki-rtr.ipv6_prefix",
450 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
451 "The IPv6 prefix of the ROA", HFILL
}
453 { &hf_rpkirtr_as_number
,
454 { "AS Number", "rpki-rtr.as_number",
455 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
456 "Autonomous System Number allowed to announce this prefix", HFILL
}
458 { &hf_rpkirtr_error_code
,
459 { "Error Code", "rpki-rtr.error_code",
460 FT_UINT16
, BASE_DEC
, VALS(rtr_error_code_vals
), 0x0,
463 { &hf_rpkirtr_length_pdu
,
464 { "Length of Encapsulated PDU", "rpki-rtr.length_pdu",
465 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
468 { &hf_rpkirtr_error_pdu
,
469 { "Erroneous PDU", "rpki-rtr.error_pdu",
470 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
473 { &hf_rpkirtr_length_text
,
474 { "Length of text", "rpki-rtr.length_text",
475 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
478 { &hf_rpkirtr_error_text
,
479 { "Erroneous Text", "rpki-rtr.error_text",
480 FT_STRING
, BASE_NONE
, NULL
, 0x0,
483 { &hf_rpkirtr_refresh_interval
,
484 { "Refresh Interval", "rpki-rtr.refresh_interval",
485 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
488 { &hf_rpkirtr_retry_interval
,
489 { "Retry Interval", "rpki-rtr.retry_interval",
490 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
493 { &hf_rpkirtr_expire_interval
,
494 { "Expire Interval", "rpki-rtr.expire_interval",
495 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
498 { &hf_rpkirtr_subject_key_identifier
,
499 { "Subject Key Identifier", "rpki-rtr.subject_key_identifier",
500 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
503 { &hf_rpkirtr_subject_public_key_info
,
504 { "Subject Public Key Info", "rpki-rtr.subject_public_key_info",
505 FT_NONE
, BASE_NONE
, NULL
, 0x0,
508 { &hf_rpkirtr_aspa_provider_as_count
,
509 { "ASPA Provider AS Count", "rpki-rtr.aspa_ascount",
510 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
511 "The Provider AS Count is the number of 32-bit Provider Autonomous System Numbers in the PDU", HFILL
}
513 { &hf_rpkirtr_aspa_customer_asn
,
514 { "ASPA Customer ASN", "rpki-rtr.aspa_customer_asn",
515 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
516 "The Customer Autonomous System Number is the 32-bit Autonomous System Number of the customer which authenticated the ASPA RPKI data", HFILL
}
518 { &hf_rpkirtr_aspa_provider_asn
,
519 { "ASPA Provider ASN", "rpki-rtr.aspa_provider_asn",
520 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
525 static int *ett
[] = {
532 static ei_register_info ei
[] = {
533 { &ei_rpkirtr_wrong_version_aspa
, { "rpkirtr.aspa.wrong_version", PI_MALFORMED
, PI_WARN
, "Wrong version for ASPA type", EXPFILL
}},
534 { &ei_rpkirtr_wrong_version_router_key
, { "rpkirtr.router_key.wrong_version", PI_MALFORMED
, PI_WARN
, "Wrong version for Router Key type", EXPFILL
}},
535 { &ei_rpkirtr_bad_length
, { "rpkirtr.bad_length", PI_MALFORMED
, PI_ERROR
, "Invalid length field", EXPFILL
}},
538 expert_module_t
*expert_rpkirtr
;
540 proto_rpkirtr
= proto_register_protocol("RPKI-Router Protocol",
541 "RPKI-Router Protocol", "rpkirtr");
543 proto_register_field_array(proto_rpkirtr
, hf
, array_length(hf
));
544 proto_register_subtree_array(ett
, array_length(ett
));
546 rpkirtr_module
= prefs_register_protocol(proto_rpkirtr
,
547 proto_reg_handoff_rpkirtr
);
549 prefs_register_uint_preference(rpkirtr_module
, "tcp.rpkirtr_tls.port", "RPKI-RTR TCP TLS Port",
550 "RPKI-Router Protocol TCP TLS port if other than the default",
551 10, &g_port_rpkirtr_tls
);
553 expert_rpkirtr
= expert_register_protocol(proto_rpkirtr
);
554 expert_register_field_array(expert_rpkirtr
, ei
, array_length(ei
));
555 rpkirtr_handle
= register_dissector("rpkirtr", dissect_rpkirtr
, proto_rpkirtr
);
560 proto_reg_handoff_rpkirtr(void)
562 static bool initialized
= false;
563 static int rpki_rtr_tls_port
;
566 dissector_add_uint_with_preference("tcp.port", RPKI_RTR_TCP_PORT
, rpkirtr_handle
);
569 ssl_dissector_delete(rpki_rtr_tls_port
, rpkirtr_handle
);
572 rpki_rtr_tls_port
= g_port_rpkirtr_tls
;
573 ssl_dissector_add(rpki_rtr_tls_port
, rpkirtr_handle
);
578 * Editor modelines - https://www.wireshark.org/tools/modelines.html
583 * indent-tabs-mode: nil
586 * vi: set shiftwidth=4 tabstop=8 expandtab:
587 * :indentSize=4:tabSize=8:noTabs=true: