#define icmp_data icmp_dun.id_data
};
-#define ICMP_MPLS_EXT_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
+#define ICMP_EXT_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
#define ICMP_MPLS_EXT_VERSION 2
/*
((type) == ICMP_UNREACH || (type) == ICMP_SOURCEQUENCH || \
(type) == ICMP_REDIRECT || (type) == ICMP_TIMXCEED || \
(type) == ICMP_PARAMPROB)
-#define ICMP_MPLS_EXT_TYPE(type) \
+#define ICMP_MULTIPART_EXT_TYPE(type) \
((type) == ICMP_UNREACH || \
(type) == ICMP_TIMXCEED || \
(type) == ICMP_PARAMPROB)
#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* precedence cutoff */
#endif
+/* rfc4950 */
+#define MPLS_STACK_ENTRY_OBJECT_CLASS 1
+/* rfc5837 */
+#define INTERFACE_INFORMATION_OBJECT_CLASS 2
+
/* Most of the icmp types */
static const struct tok icmp2str[] = {
{ ICMP_ECHOREPLY, "echo reply" },
nd_byte icmp_ext_data[1];
};
-struct icmp_mpls_ext_object_header_t {
+struct icmp_multipart_ext_object_header_t {
nd_uint16_t length;
nd_uint8_t class_num;
nd_uint8_t ctype;
};
-static const struct tok icmp_mpls_ext_obj_values[] = {
+static const struct tok icmp_multipart_ext_obj_values[] = {
{ 1, "MPLS Stack Entry" },
- { 2, "Extended Payload" },
+ { 2, "Interface Identification" },
{ 0, NULL}
};
const struct udphdr *ouh;
const uint8_t *obj_tptr;
uint32_t raw_label;
- const struct icmp_mpls_ext_object_header_t *icmp_mpls_ext_object_header;
+ const struct icmp_multipart_ext_object_header_t *icmp_multipart_ext_object_header;
u_int hlen, mtu, obj_tlen, obj_class_num, obj_ctype;
uint16_t dport;
char buf[MAXHOSTNAMELEN + 100];
ndo->ndo_protocol = "icmp";
/*
- * Attempt to decode the MPLS extensions only for some ICMP types.
+ * Attempt to decode multi-part message extensions (rfc4884) only for some ICMP types.
*/
- if (ndo->ndo_vflag >= 1 && plen > ICMP_EXTD_MINLEN && ICMP_MPLS_EXT_TYPE(icmp_type)) {
+ if (ndo->ndo_vflag >= 1 && plen > ICMP_EXTD_MINLEN && ICMP_MULTIPART_EXT_TYPE(icmp_type)) {
ND_TCHECK_SIZE(ext_dp);
/*
- * Check first if the mpls extension header shows a non-zero length.
+ * Check first if the multi-part extension header shows a non-zero length.
* If the length field is not set then silently verify the checksum
* to check if an extension header is present. This is expedient,
* however not all implementations set the length field proper.
}
}
- ND_PRINT("\n\tMPLS extension v%u",
- ICMP_MPLS_EXT_EXTRACT_VERSION(*(ext_dp->icmp_ext_version_res)));
+ ND_PRINT("\n\tICMP Multi-Part extension v%u",
+ ICMP_EXT_EXTRACT_VERSION(*(ext_dp->icmp_ext_version_res)));
/*
* Sanity checking of the header.
*/
- if (ICMP_MPLS_EXT_EXTRACT_VERSION(*(ext_dp->icmp_ext_version_res)) !=
+ if (ICMP_EXT_EXTRACT_VERSION(*(ext_dp->icmp_ext_version_res)) !=
ICMP_MPLS_EXT_VERSION) {
ND_PRINT(" packet not supported");
return;
hlen -= 4; /* subtract common header size */
obj_tptr = (const uint8_t *)ext_dp->icmp_ext_data;
- while (hlen > sizeof(struct icmp_mpls_ext_object_header_t)) {
+ while (hlen > sizeof(struct icmp_multipart_ext_object_header_t)) {
- icmp_mpls_ext_object_header = (const struct icmp_mpls_ext_object_header_t *)obj_tptr;
- ND_TCHECK_SIZE(icmp_mpls_ext_object_header);
- obj_tlen = GET_BE_U_2(icmp_mpls_ext_object_header->length);
- obj_class_num = GET_U_1(icmp_mpls_ext_object_header->class_num);
- obj_ctype = GET_U_1(icmp_mpls_ext_object_header->ctype);
- obj_tptr += sizeof(struct icmp_mpls_ext_object_header_t);
+ icmp_multipart_ext_object_header = (const struct icmp_multipart_ext_object_header_t *)obj_tptr;
+ ND_TCHECK_SIZE(icmp_multipart_ext_object_header);
+ obj_tlen = GET_BE_U_2(icmp_multipart_ext_object_header->length);
+ obj_class_num = GET_U_1(icmp_multipart_ext_object_header->class_num);
+ obj_ctype = GET_U_1(icmp_multipart_ext_object_header->ctype);
+ obj_tptr += sizeof(struct icmp_multipart_ext_object_header_t);
ND_PRINT("\n\t %s Object (%u), Class-Type: %u, length %u",
- tok2str(icmp_mpls_ext_obj_values,"unknown",obj_class_num),
+ tok2str(icmp_multipart_ext_obj_values,"unknown",obj_class_num),
obj_class_num,
obj_ctype,
obj_tlen);
- hlen-=sizeof(struct icmp_mpls_ext_object_header_t); /* length field includes tlv header */
+ hlen-=sizeof(struct icmp_multipart_ext_object_header_t); /* length field includes tlv header */
/* infinite loop protection */
if ((obj_class_num == 0) ||
- (obj_tlen < sizeof(struct icmp_mpls_ext_object_header_t))) {
+ (obj_tlen < sizeof(struct icmp_multipart_ext_object_header_t))) {
return;
}
- obj_tlen-=sizeof(struct icmp_mpls_ext_object_header_t);
+ obj_tlen-=sizeof(struct icmp_multipart_ext_object_header_t);
switch (obj_class_num) {
case 1:
62.220.31.247 > 62.225.245.115: ICMP 62.220.31.247 udp port 1027 unreachable, length 13891
(tos 0xa0, ttl 114, id 30054, offset 0, flags [none], proto UDP (17), length 13728, bad cksum 3f1f (->a1f)!)
62.225.245.115.9109 > 62.220.31.247.1027: [bad udp cksum 0xdfe7 -> 0xdb95!] UDP, length 132
- MPLS extension v0 packet not supported
+ ICMP Multi-Part extension v0 packet not supported
10.4.0.34 > 12.4.4.4: ICMP time exceeded in-transit, length 32988
(tos 0x0, ttl 1, id 42321, offset 0, flags [none], proto UDP (17), length 40)
12.4.4.4.42315 > 12.1.1.1.33440: [bad udp cksum 0x1000 -> 0xbad0!] UDP, length 12
- MPLS extension v2
- Extended Payload Object (2), Class-Type: 14, length 80
+ ICMP Multi-Part extension v2
+ Interface Identification Object (2), Class-Type: 14, length 80
0x0000: 0000 000f 0001 0000 0a0a 0a0a 3f54 6869
0x0010: 732d 6973 2d74 6865 2d6e 616d 652d 6f66
0x0020: 2d74 6865 2d49 6e74 6572 6661 6365 2d74
97.242.24.11 > 97.242.24.11: ICMP 97.242.24.11 udp port 162 unreachable, length 4399
(tos 0x0, ttl 128, id 30661, offset 0, flags [DF], proto UDP (17), length 295)
97.242.24.11.60377 > 97.242.24.11.162: [udp sum ok] { SNMPv1 C="trap" { Trap(251) .1.3.6.1.4.1.3830.1.1.2.2.1 97.242.24.11 enterpriseSpecific s=52 61498489 .1.3.6.1.4.1.3830.1.1.2.1.1.1=3 .1.3.6.1.4.1.3830.1.1.2.1.1.2=2 .1.3.6.1.4.1.3830.1.1.2.1.1.3="%SMSA-E-POLLERR, Polling the SMSC was not successful." .1.3.6.1.4.1.3830.1.1.2.1.1.4="OPCOM" .1.3.6.1.4.1.3830.1.1.2.1.1.5="28-OCT-2010 20:42:14.67" .1.3.6.1.4.1.3830.1.1.2.1.1.6="SMRL51" } }
- MPLS extension v0 packet not supported
+ ICMP Multi-Part extension v0 packet not supported
10.0.12.2 > 10.0.12.1: ICMP time exceeded in-transit, length 8340
(tos 0x0, ttl 1, id 2574, offset 0, flags [none], proto UDP (17), length 28)
10.0.12.1.49215 > 10.255.255.4.33435: [udp sum ok] UDP, length 0
- MPLS extension v2
+ ICMP Multi-Part extension v2
MPLS Stack Entry Object (1), Class-Type: 1, length 8
label 16, tc 0, [S], ttl 1 [|icmp]
10.5.0.1 > 12.4.4.4: ICMP time exceeded in-transit, length 148
IP (tos 0x0, ttl 1, id 42316, offset 0, flags [none], proto UDP (17), length 40)
12.4.4.4.42315 > 12.1.1.1.33435: UDP, length 12
- MPLS extension v2, checksum 0xc55f (correct), length 12
+ ICMP Multi-Part extension v2, checksum 0xc55f (correct), length 12
MPLS Stack Entry Object (1), Class-Type: 1, length 8
label 100704, tc 0, [S], ttl 1
3 10:13:29.319182 MPLS (label 100704, tc 0, [S], ttl 1)
10.5.0.1 > 12.4.4.4: ICMP time exceeded in-transit, length 148
IP (tos 0x0, ttl 1, id 42317, offset 0, flags [none], proto UDP (17), length 40)
12.4.4.4.42315 > 12.1.1.1.33436: UDP, length 12
- MPLS extension v2, checksum 0xc55f (correct), length 12
+ ICMP Multi-Part extension v2, checksum 0xc55f (correct), length 12
MPLS Stack Entry Object (1), Class-Type: 1, length 8
label 100704, tc 0, [S], ttl 1
5 10:13:29.326697 MPLS (label 100704, tc 0, [S], ttl 1)
10.5.0.1 > 12.4.4.4: ICMP time exceeded in-transit, length 148
IP (tos 0x0, ttl 1, id 42318, offset 0, flags [none], proto UDP (17), length 40)
12.4.4.4.42315 > 12.1.1.1.33437: UDP, length 12
- MPLS extension v2, checksum 0xc55f (correct), length 12
+ ICMP Multi-Part extension v2, checksum 0xc55f (correct), length 12
MPLS Stack Entry Object (1), Class-Type: 1, length 8
label 100704, tc 0, [S], ttl 1
7 10:13:29.327769 MPLS (label 100704, tc 0, [S], ttl 2)
10.4.0.2 > 12.4.4.4: ICMP time exceeded in-transit, length 148
IP (tos 0x0, ttl 1, id 42319, offset 0, flags [none], proto UDP (17), length 40)
12.4.4.4.42315 > 12.1.1.1.33438: UDP, length 12
- MPLS extension v2, checksum 0xc4e4 (correct), length 12
+ ICMP Multi-Part extension v2, checksum 0xc4e4 (correct), length 12
MPLS Stack Entry Object (1), Class-Type: 1, length 8
label 102672, tc 0, [S], ttl 1
9 10:13:29.330110 MPLS (label 100704, tc 0, [S], ttl 2)
10.4.0.2 > 12.4.4.4: ICMP time exceeded in-transit, length 148
IP (tos 0x0, ttl 1, id 42320, offset 0, flags [none], proto UDP (17), length 40)
12.4.4.4.42315 > 12.1.1.1.33439: UDP, length 12
- MPLS extension v2, checksum 0xc4e4 (correct), length 12
+ ICMP Multi-Part extension v2, checksum 0xc4e4 (correct), length 12
MPLS Stack Entry Object (1), Class-Type: 1, length 8
label 102672, tc 0, [S], ttl 1
11 10:13:29.331066 MPLS (label 100704, tc 0, [S], ttl 2)
10.4.0.2 > 12.4.4.4: ICMP time exceeded in-transit, length 148
IP (tos 0x0, ttl 1, id 42321, offset 0, flags [none], proto UDP (17), length 40)
12.4.4.4.42315 > 12.1.1.1.33440: UDP, length 12
- MPLS extension v2, checksum 0xc4e4 (correct), length 12
+ ICMP Multi-Part extension v2, checksum 0xc4e4 (correct), length 12
MPLS Stack Entry Object (1), Class-Type: 1, length 8
label 102672, tc 0, [S], ttl 1
13 10:13:29.332494 MPLS (label 100704, tc 0, [S], ttl 3)