bootp: Add Captive-Portal option (160)
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Mon, 13 Mar 2017 14:12:50 +0000 (15:12 +0100)
committerMichael Mann <mmann78@netscape.net>
Tue, 14 Mar 2017 00:58:53 +0000 (00:58 +0000)
Thanks to David Bird for pcap

Bug: 13483
Change-Id: Id53eadd5faa7599c3864840aa80a8770099baac3
Reviewed-on: https://code.wireshark.org/review/20531
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
epan/dissectors/packet-bootp.c

index a3c70a92ced38c0e400ed160f69088910d61448a..1b234283176beb6c6f3e20d6648562a801105ec7 100644 (file)
@@ -53,6 +53,7 @@
  * RFC 5417: CAPWAP Access Controller DHCP Option
  * RFC 5969: IPv6 Rapid Deployment on IPv4 Infrastructures (6rd)
  * RFC 6607: Virtual Subnet Selection Options for DHCPv4 and DHCPv6
+ * RFC 7710: Captive-Portal Identification Using DHCP or Router Advertisements (RAs)
  * draft-ietf-dhc-fqdn-option-07.txt
  * TFTP Server Address Option for DHCPv4 [draft-raj-dhc-tftp-addr-option-06.txt: http://tools.ietf.org/html/draft-raj-dhc-tftp-addr-option-06]
  * BOOTP and DHCP Parameters
@@ -534,6 +535,7 @@ static int hf_bootp_option_subnet_selection_option = -1;            /* 118 */
 static int hf_bootp_option_lost_server_domain_name = -1;               /* 137 */
 static int hf_bootp_option_capwap_access_controller = -1;              /* 138 */
 static int hf_bootp_option_tftp_server_address = -1;                   /* 150 */
+static int hf_bootp_option_captive_portal = -1;                                /* 160 */
 static int hf_bootp_option_mudurl = -1;                                        /* 161 */
 static int hf_bootp_option_pxe_config_file = -1;                       /* 209 */
 static int hf_bootp_option_pxe_path_prefix = -1;                       /* 210 */
@@ -1377,7 +1379,7 @@ static struct opt_info default_bootp_opt[BOOTP_OPT_NUM] = {
 /* 157 */ { "Unassigned",                              opaque, NULL },
 /* 158 */ { "Unassigned",                              opaque, NULL },
 /* 159 */ { "Unassigned",                              opaque, NULL },
-/* 160 */ { "Unassigned",                              opaque, NULL },
+/* 160 */ { "DHCP Captive-Portal",                     special, NULL },
 /* 161 */ { "Manufacturer Usage Description",          string, &hf_bootp_option_mudurl},
 /* 162 */ { "Unassigned",                              opaque, NULL },
 /* 163 */ { "Unassigned",                              opaque, NULL },
@@ -2911,6 +2913,14 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
                break;
        }
 
+       case 160: {     /* DHCP Captive-Portal */
+               proto_item *ti_cp;
+               ti_cp = proto_tree_add_item(v_tree, hf_bootp_option_captive_portal, tvb, optoff, optlen, ENC_ASCII|ENC_NA);
+               PROTO_ITEM_SET_URL(ti_cp);
+               break;
+       }
+
+
        case 212: {     /* 6RD option (RFC 5969) */
                if (optlen < 22) {
                        expert_add_info(pinfo, vti, &ei_bootp_option_6RD_malformed);
@@ -8375,6 +8385,11 @@ proto_register_bootp(void)
                    FT_STRING, BASE_NONE, NULL, 0x0,
                    "Option 210: PXE Path Prefix", HFILL }},
 
+               { &hf_bootp_option_captive_portal,
+                 { "Captive Portal", "bootp.option.captive_portal",
+                   FT_STRING, BASE_NONE, NULL, 0x0,
+                   "The contact URI for the captive portal that the user should connect to", HFILL }},
+
                { &hf_bootp_option_6RD_ipv4_mask_len,
                  { "6RD IPv4 Mask Length", "bootp.option.6RD.ipv4_mask_len",
                    FT_UINT8, BASE_DEC, NULL, 0x0,