Lines Matching +full:ip +full:- +full:76

26 #include "netdissect-stdinc.h"
38 * This file specifies the "implementation-independent" BOOTP protocol
62 nd_uint16_t bp_flags; /* flags - see bootp_flag_values[]
63 in print-bootp.c */
64 nd_ipv4 bp_ciaddr; /* client IP address */
65 nd_ipv4 bp_yiaddr; /* 'your' IP address */
66 nd_ipv4 bp_siaddr; /* server IP address */
67 nd_ipv4 bp_giaddr; /* gateway IP address */
71 nd_byte bp_vend[64]; /* vendor-specific area */
155 #define TAG_STREETTALK_STDA ((uint8_t) 76)
187 /* RFC 3004 - The User Class Option for DHCP */
196 /* RFC 5859 - TFTP Server Address Option for DHCPv4 */
198 /* https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml */
246 nd_ipv4 v_ins1, v_ins2; /* IEN-116 name servers */
290 ndo->ndo_protocol = "bootp";
292 bp_op = GET_U_1(bp->bp_op);
296 bp_htype = GET_U_1(bp->bp_htype);
297 bp_hlen = GET_U_1(bp->bp_hlen);
299 ND_PRINT(" from %s", GET_ETHERADDR_STRING(bp->bp_chaddr));
304 if (!ndo->ndo_vflag)
307 ND_TCHECK_2(bp->bp_secs);
318 if (GET_U_1(bp->bp_hops))
319 ND_PRINT(", hops %u", GET_U_1(bp->bp_hops));
320 if (GET_BE_U_4(bp->bp_xid))
321 ND_PRINT(", xid 0x%x", GET_BE_U_4(bp->bp_xid));
322 if (GET_BE_U_2(bp->bp_secs))
323 ND_PRINT(", secs %u", GET_BE_U_2(bp->bp_secs));
326 bittok2str(bootp_flag_values, "none", GET_BE_U_2(bp->bp_flags)));
327 if (ndo->ndo_vflag > 1)
328 ND_PRINT(" (0x%04x)", GET_BE_U_2(bp->bp_flags));
330 /* Client's ip address */
331 if (GET_IPV4_TO_NETWORK_ORDER(bp->bp_ciaddr))
332 ND_PRINT("\n\t Client-IP %s", GET_IPADDR_STRING(bp->bp_ciaddr));
334 /* 'your' ip address (bootp client) */
335 if (GET_IPV4_TO_NETWORK_ORDER(bp->bp_yiaddr))
336 ND_PRINT("\n\t Your-IP %s", GET_IPADDR_STRING(bp->bp_yiaddr));
338 /* Server's ip address */
339 if (GET_IPV4_TO_NETWORK_ORDER(bp->bp_siaddr))
340 ND_PRINT("\n\t Server-IP %s", GET_IPADDR_STRING(bp->bp_siaddr));
342 /* Gateway's ip address */
343 if (GET_IPV4_TO_NETWORK_ORDER(bp->bp_giaddr))
344 ND_PRINT("\n\t Gateway-IP %s", GET_IPADDR_STRING(bp->bp_giaddr));
348 ND_PRINT("\n\t Client-Ethernet-Address %s", GET_ETHERADDR_STRING(bp->bp_chaddr));
351 if (GET_U_1(bp->bp_sname)) { /* get first char only */
353 if (nd_printztn(ndo, bp->bp_sname, (u_int)sizeof(bp->bp_sname),
354 ndo->ndo_snapend) == 0) {
361 if (GET_U_1(bp->bp_file)) { /* get first char only */
363 if (nd_printztn(ndo, bp->bp_file, (u_int)sizeof(bp->bp_file),
364 ndo->ndo_snapend) == 0) {
373 ND_TCHECK_4(bp->bp_vend);
374 if (memcmp((const char *)bp->bp_vend, vm_rfc1048,
376 rfc1048_print(ndo, bp->bp_vend);
377 else if (memcmp((const char *)bp->bp_vend, vm_cmu,
379 cmu_print(ndo, bp->bp_vend);
383 ul = GET_BE_U_4(bp->bp_vend);
385 ND_PRINT("\n\t Vendor-#0x%x", ul);
395 * i - ip address (32 bits)
396 * p - ip address pairs (32 bits + 32 bits)
397 * l - long (32 bits)
398 * L - unsigned long (32 bits)
399 * s - short (16 bits)
400 * b - period-separated decimal bytes (variable length)
401 * x - colon-separated hex bytes (variable length)
402 * a - ASCII string (variable length)
403 * B - on/off (8 bits)
404 * $ - special (explicit code to handle)
409 { TAG_SUBNET_MASK, "iSubnet-Mask" }, /* subnet mask (RFC950) */
410 { TAG_TIME_OFFSET, "LTime-Zone" }, /* seconds from UTC */
411 { TAG_GATEWAY, "iDefault-Gateway" }, /* default gateway */
412 { TAG_TIME_SERVER, "iTime-Server" }, /* time servers (RFC868) */
413 { TAG_NAME_SERVER, "iIEN-Name-Server" }, /* IEN name servers (IEN116) */
414 { TAG_DOMAIN_SERVER, "iDomain-Name-Server" }, /* domain name (RFC1035) */
417 { TAG_LPR_SERVER, "iLPR-Server" }, /* lpr server (RFC1179) */
425 { TAG_DOMAINNAME, "aDomain-Name" },
435 { TAG_MTU_TIMEOUT, "lMTU-Timeout" },
436 { TAG_MTU_TABLE, "sMTU-Table" },
442 { TAG_DO_RDISC, "BRouter-Discovery" },
444 { TAG_STATIC_ROUTE, "pStatic-Route" },
454 { TAG_VENDOR_OPTS, "bVendor-Option" },
455 { TAG_NETBIOS_NS, "iNetbios-Name-Server" },
457 { TAG_NETBIOS_NODE, "$Netbios-Node" },
458 { TAG_NETBIOS_SCOPE, "aNetbios-Scope" },
472 { TAG_REQUESTED_IP, "iRequested-IP" },
473 { TAG_IP_LEASE, "lLease-Time" },
477 { TAG_DHCP_MESSAGE, " DHCP-Message" },
478 { TAG_SERVER_ID, "iServer-ID" },
479 { TAG_PARM_REQUEST, "bParameter-Request" },
484 { TAG_VENDOR_CLASS, "aVendor-Class" },
485 { TAG_CLIENT_ID, "$Client-ID" },
491 { TAG_SLP_DA, "bSLP-DA" }, /*"b" is a little wrong */
492 { TAG_SLP_SCOPE, "bSLP-SCOPE" }, /*"b" is a little wrong */
495 /* RFC 3004 - The User Class Option for DHCP */
496 { TAG_USER_CLASS, "$User-Class" },
500 { TAG_CLASSLESS_STATIC_RT, "$Classless-Static-Route" },
501 { TAG_CLASSLESS_STA_RT_MS, "$Classless-Static-Route-Microsoft" },
503 { TAG_SZTP_REDIRECT, "$SZTP-Redirect" },
504 /* RFC 5859 - TFTP Server Address Option for DHCPv4 */
505 { TAG_TFTP_SERVER_ADDRESS, "iTFTP-Server-Address" },
506 /* https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml#options */
507 { TAG_SLP_NAMING_AUTH, "aSLP-NA" },
509 { TAG_AGENT_CIRCUIT, "$Agent-Information" },
514 { TAG_CLIENT_LAST_TRANSACTION_TIME, "LLast-Transaction-Time" },
515 { TAG_ASSOCIATED_IP, "iAssociated-IP" },
520 { TAG_TZ_PCODE, "aPOSIX-TZ" },
521 { TAG_TZ_TCODE, "aTZ-Name" },
525 { TAG_MUDURL, "aMUD-URL" },
537 /* NETBIOS over TCP/IP node type options */
539 { 0x1, "b-node" },
540 { 0x2, "p-node" },
541 { 0x4, "m-node" },
542 { 0x8, "h-node" },
546 /* ARP Hardware types, for Client-ID option */
577 { AGENT_SUBOPTION_CIRCUIT_ID, "Circuit-ID" },
578 { AGENT_SUBOPTION_REMOTE_ID, "Remote-ID" },
579 { AGENT_SUBOPTION_SUBSCRIBER_ID, "Subscriber-ID" },
595 ND_PRINT("\n\t Vendor-rfc1048 Extensions");
605 if (tag == TAG_PAD && ndo->ndo_vflag < 3)
607 if (tag == TAG_END && ndo->ndo_vflag < 3)
623 if (tag == TAG_PAD && ndo->ndo_vflag > 2) {
648 len--;
676 if (nd_printn(ndo, bp, len, ndo->ndo_snapend)) {
688 /* ip addresses/32-bit words */
699 len -= 4;
705 /* IP address pairs */
711 len -= 4;
714 len -= 4;
726 len -= 2;
750 --len;
769 --len;
786 --len;
798 --len;
823 if (nd_printn(ndo, bp, len - 3, ndo->ndo_snapend)) {
828 bp += len - 3;
843 len--;
846 if (nd_printn(ndo, bp, len, ndo->ndo_snapend)) {
855 ND_PRINT("%s ", tok2str(arp2str, "hardware-type %u,", type));
861 --len;
873 len -= 2;
892 if (nd_printn(ndo, bp, suboptlen, ndo->ndo_snapend))
900 len -= suboptlen;
922 len--;
955 len -= (significant_octets + 4);
975 len--;
979 ND_PRINT("[ERROR: suboption length must be non-zero]");
991 if (nd_printn(ndo, bp, suboptlen, ndo->ndo_snapend)) {
998 len -= suboptlen;
1006 /* as per https://datatracker.ietf.org/doc/html/rfc8572#section-8.3
1007 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
1008 | uri-length | URI |
1009 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
1011 * uri-length: 2 octets long; specifies the length of the URI data.
1017 len -= 2;
1029 len -= suboptlen;
1057 #define PRINTCMUADDR(m, s) { ND_TCHECK_4(cmu->m); \
1058 if (GET_IPV4_TO_NETWORK_ORDER(cmu->m) != 0) \
1059 ND_PRINT(" %s:%s", s, GET_IPADDR_STRING(cmu->m)); }
1068 ND_PRINT(" vend-cmu");
1072 ND_TCHECK_4(cmu->v_flags);
1073 v_flags = GET_U_1(cmu->v_flags);