lib/packetgen/header/ike/id.rb in packetgen-2.6.0 vs lib/packetgen/header/ike/id.rb in packetgen-2.7.0
- old
+ new
@@ -7,11 +7,10 @@
# frozen_string_literal: true
module PacketGen
module Header
class IKE
-
# This class handles Identification - Initiator payloads, denoted IDi
# (see RFC 7296, ยง3.5).
#
# A ID payload consists of the IKE generic payload header (see {Payload})
# and some specific fields:
@@ -36,11 +35,10 @@
# pkt = PacketGen.gen('IP').add('UDP').add('IKE').add('IKE::IDi', type: 'FQDN')
# pkt.ike_idi.content.read 'fqdn.example.org'
# pkt.calc_length
# @author Sylvain Daubert
class IDi < Payload
-
# Payload type number
PAYLOAD_TYPE = 35
TYPES = {
'IPV4_ADDR' => 1,
@@ -48,10 +46,10 @@
'RFC822_ADDR' => 3,
'IPV6_ADDR' => 5,
'DER_ASN1_DN' => 9,
'DER_ASN1_GN' => 10,
'KEY_ID' => 11
- }
+ }.freeze
# @attribute [r] type
# 8-bit ID type
# @return [Integer]
define_field_before :content, :type, Types::Int8Enum, enum: TYPES