Class: PacketGen::Header::IKE::Nonce

Inherits:
Payload show all
Defined in:
lib/packetgen/header/ike/nonce.rb

Overview

This class handles Nonce payloads, as defined in RFC 7296 §3.9.

A Nonce payload contains a generic payload header (see Payload) and data field (type Types::String):

                     1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Payload  |C|  RESERVED   |         Payload Length        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                            Nonce Data                         ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Create a Nonce payload

# Create a IKE packet with a Nonce payload
pkt = PacketGen.gen('IP').add('UDP').add('IKE')
pkt.add('IKE::Nonce', data: "abcdefgh")
pkt.calc_length

Author:

  • Sylvain Daubert

Since:

  • 2.0.0

Constant Summary collapse

PAYLOAD_TYPE =

Payload type number

Since:

  • 2.0.0

40

Instance Attribute Summary

Attributes inherited from Payload

#content, #critical, #flags, #hreserved, #length, #next

Attributes inherited from Base

#packet

Method Summary

Methods inherited from Payload

#base_read, #calc_length, #initialize, #read

Methods inherited from Base

#added_to_packet, bind, bind_header, calculate_and_set_length, #header_id, inherited, #initialize, #ip_header, known_headers, #ll_header, #method_name, #parse?, #protocol_name, protocol_name

Methods inherited from Types::Fields

#[], #[]=, #bits_on, #body=, define_bit_fields_on, define_field, define_field_after, define_field_before, delete_field, fields, #fields, #force_binary, inherited, #initialize, #inspect, #is_optional?, #is_present?, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field

Constructor Details

This class inherits a constructor from PacketGen::Header::IKE::Payload