Send kea-dev mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/kea-dev
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of kea-dev digest..."


Today's Topics:

   1. Re:  [Potential Spoof] hook library question: parsing
      DHO_DHCP_AGENT_OPTIONS sub options in incoming packets (Angelo Failla)
   2. Re:  hook library question: parsing DHO_DHCP_AGENT_OPTIONS
      sub options in incoming packets (Angelo Failla)


----------------------------------------------------------------------

Message: 1
Date: Thu, 3 Nov 2016 14:55:17 +0000
From: Angelo Failla <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Re: [kea-dev] [Potential Spoof] hook library question:
        parsing DHO_DHCP_AGENT_OPTIONS sub options in incoming packets
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

On 11/3/16, 11:34 AM, "kea-dev on behalf of Angelo Failla" 
<[email protected] on behalf of [email protected]> wrote:

>   Hi,
>    I have a question about retrieving DHO_DHCP_AGENT_OPTIONS from an incoming 
> dhcpv4 DISCOVER packet.
    
Do I have to use user-defined options in the kea config file?

-- 
Angelo Failla

Cluster Infrastructure - Dublin
[email protected]



------------------------------

Message: 2
Date: Thu, 3 Nov 2016 15:51:39 +0000
From: Angelo Failla <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Re: [kea-dev] hook library question: parsing
        DHO_DHCP_AGENT_OPTIONS sub options in incoming packets
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Never mind I solved my issue.I needed to build the option and suboptions like 
this in my unit test:

// add options 82 (both suboptions) to the request.
  OptionDefinitionPtr rai_def =
      LibDHCP::getOptionDef(Option::V4, DHO_DHCP_AGENT_OPTIONS);
  ASSERT_TRUE(rai_def);
  OptionCustomPtr rai(new OptionCustom(*rai_def, Option::V4));

  const uint8_t circuit_id_data[] = {
    0x01, 0x11, // Agent Circuit ID (length = 17)
    // "Ethernet10:2026"
    0x00, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x31, 0x30,
    0x3a, 0x32, 0x30, 0x32, 0x36
  };
  OptionPtr circuit_id(new Option(
      Option::V4,
      RAI_OPTION_AGENT_CIRCUIT_ID,
      OptionBuffer(
          circuit_id_data, circuit_id_data + sizeof(circuit_id_data))));
  rai->addOption(circuit_id);

  const uint8_t agent_remote_id_data[] = {
    0x02, 0x13, // Agent Remote ID (length = 19)
    // "00:1c:73:8c:d0:e5"
    0x00, 0x11, 0x30, 0x30, 0x3a, 0x31, 0x63, 0x3a, 0x37, 0x33, 0x3a, 0x38,
    0x63, 0x3a, 0x64, 0x30, 0x3a, 0x65, 0x35
  };
  OptionPtr agent_remote_id(new Option(
      Option::V4,
      RAI_OPTION_REMOTE_ID,
      OptionBuffer(
          agent_remote_id_data,
          agent_remote_id_data + sizeof(agent_remote_id_data))));
  // OptionBuffer agent_info_buf = createAgentInformationOption();
  rai->addOption(agent_remote_id);

  // auto agent_info = boost::make_shared<Option>(
  //     Option::V4, DHO_DHCP_AGENT_OPTIONS, agent_info_buf);
  query->addOption(rai);

  handle_->setArgument("query4", query);



Then on the server side:

OptionDefinitionPtr rai_def =
      LibDHCP::getOptionDef(Option::V4, DHO_DHCP_AGENT_OPTIONS);
 OptionCustomPtr rai = boost::dynamic_pointer_cast<OptionCustom>(
       query4_ptr->getOption(DHO_DHCP_AGENT_OPTIONS));
 OptionPtr circuit_id_opt = rai->getOption(RAI_OPTION_AGENT_CIRCUIT_ID);


-- 
Angelo Failla

Cluster Infrastructure - Dublin
[email protected]

On 11/3/16, 2:55 PM, "kea-dev on behalf of Angelo Failla" 
<[email protected] on behalf of [email protected]> wrote:

    On 11/3/16, 11:34 AM, "kea-dev on behalf of Angelo Failla" 
<[email protected] on behalf of [email protected]> wrote:
    
    >   Hi,
    >    I have a question about retrieving DHO_DHCP_AGENT_OPTIONS from an 
incoming dhcpv4 DISCOVER packet.
        
    Do I have to use user-defined options in the kea config file?
    
    -- 
    Angelo Failla
    
    Cluster Infrastructure - Dublin
    [email protected]
    
    
    _______________________________________________
    kea-dev mailing list
    [email protected]
    
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.isc.org_mailman_listinfo_kea-2Ddev&d=DQICAg&c=5VD0RTtNlTh3ycd41b3MUw&r=XQHjLQh2eTTW8a0c8kaZ9Q&m=2K0efoRQ7oy0V1GYLFYmfCLXWHYrJGJN7oB4MNbEwWU&s=I26BEEOW0DCCLRo71OOrM-tIsnOJyxSe3f80Fvq2S-8&e=
 
    


------------------------------

Subject: Digest Footer

_______________________________________________
kea-dev mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-dev

------------------------------

End of kea-dev Digest, Vol 32, Issue 2
**************************************

Reply via email to