Skip to content

Commit

Permalink
Improve the names of enum literals generated from IANA registries
Browse files Browse the repository at this point in the history
* The names are simplified by keeping only the first word of the original
  string.
* When either (Deprecated) or (Obsolete) is contained in the original
  string, then add the respective prefix.
* Update generated specifications
* Update manually written specifications (tls_handshake.rflx)

Ref. eng/recordflux/RecordFlux#1451
  • Loading branch information
andrestt committed Nov 7, 2023
1 parent 1ad07f4 commit 2219e75
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 56 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Syntax for passing repeated `-i` and `-v` options to `rflx validate` (eng/recordflux/RecordFlux#1441)
- Simplified setter code and removed internal `Successor` function (eng/recordflux/RecordFlux#1448)
- Improve the names of enum literals generated from IANA registries (eng/recordflux/RecordFlux#1451)

### Fixed

Expand Down
18 changes: 9 additions & 9 deletions examples/specs/arp_parameters.rflx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- AUTOMATICALLY GENERATED. DO NOT EDIT.
-- Generation date: 2022-10-05
-- Generation date: 2023-11-03
-- Address Resolution Protocol (ARP) Parameters
-- Registry last updated on 2016-07-20

Expand Down Expand Up @@ -87,10 +87,10 @@ package Arp_Parameters is

type Hardware_Types is
(-- Ref: Jon_Postel
Ethernet_10Mb => 1,
Ethernet => 1,

-- Ref: Jon_Postel
Experimental_Ethernet_3Mb => 2,
Experimental_Ethernet => 2,

-- Ref: Philip_Koch
Amateur_Radio_AX_25 => 3,
Expand Down Expand Up @@ -120,7 +120,7 @@ package Arp_Parameters is
LocalTalk => 11,

-- xref = Joseph Murdock
LocalNet_IBM_PCNet_Or_SYTEK_LocalNET => 12,
LocalNet => 12,

-- Ref: Rajiv_Dhingra
Ultra_Link => 13,
Expand All @@ -132,7 +132,7 @@ package Arp_Parameters is
Frame_Relay => 15,

-- xref = [JXB2]
Asynchronous_Transmission_Mode_ATM_16 => 16,
Asynchronous_Transmission_Mode_16 => 16,

-- Ref: Jon_Postel
HDLC => 17,
Expand All @@ -141,13 +141,13 @@ package Arp_Parameters is
Fibre_Channel => 18,

-- Ref: rfc2225
Asynchronous_Transmission_Mode_ATM_19 => 19,
Asynchronous_Transmission_Mode_19 => 19,

-- Ref: Jon_Postel
Serial_Line => 20,

-- Ref: Mike_Burrows
Asynchronous_Transmission_Mode_ATM_21 => 21,
Asynchronous_Transmission_Mode_21 => 21,

-- Ref: Herb_Jensen
MIL_STD_188_220 => 22,
Expand Down Expand Up @@ -181,11 +181,11 @@ package Arp_Parameters is
IPsec_Tunnel => 31,

-- Ref: rfc4391
InfiniBand_TM => 32,
InfiniBand => 32,

-- xref = Jeff Anderson, Telecommunications Industry of America (TIA) TR-8.5
-- Formulating Group, <cja015&motorola.com>, June 2004
TIA_102_Project_25_Common_Air_Interface_CAI => 33,
TIA_102_Project_25_Common_Air_Interface => 33,

-- Ref: Scott_Guthery_2
Wiegand_Interface => 34,
Expand Down
48 changes: 24 additions & 24 deletions examples/specs/bootp_dhcp_parameters.rflx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- AUTOMATICALLY GENERATED. DO NOT EDIT.
-- Generation date: 2022-10-05
-- Dynamic Host Configuration Protocol (DHCP) and Bootstrap Protocol (BOOTP) Parameters
-- Generation date: 2023-11-03
-- Dynamic Host Configuration Protocol (DHCP) and Bootstrap Protocol (BOOTP)
-- Parameters
-- Registry last updated on 2021-01-15

package Bootp_Dhcp_Parameters is
Expand Down Expand Up @@ -571,47 +572,46 @@ package Bootp_Dhcp_Parameters is
V_I_Vendor_Specific_Information => 125,

-- Ref: rfc4578
-- alternative_name = PXE_Undefined_Vendor_Specific
-- alternative_name = PXE_Undefined
-- alternative_name = Etherboot_Signature_6_Bytes_E4_45_74_68_00_00
-- alternative_name = DOCSIS_Full_Security_Server_IP_Address
-- alternative_name = TFTP_Server_IP_Address_For_IP_Phone_Software_Load
-- alternative_name = TFTP_Server_IP_Address
BOOTP_Vendor_Extensions_And_DHCP_Options_128 => 128,

-- Ref: rfc4578
-- alternative_name = PXE_Undefined_Vendor_Specific
-- alternative_name = PXE_Undefined
-- alternative_name = Kernel_Options_Variable_Length_String
-- alternative_name = Call_Server_IP_Address
BOOTP_Vendor_Extensions_And_DHCP_Options_129 => 129,

-- Ref: rfc4578
-- alternative_name = PXE_Undefined_Vendor_Specific
-- alternative_name = PXE_Undefined
-- alternative_name = Ethernet_Interface_Variable_Length_String
-- alternative_name = Discrimination_String_To_Identify_Vendor
-- alternative_name = Discrimination_String
BOOTP_Vendor_Extensions_And_DHCP_Options_130 => 130,

-- Ref: rfc4578
-- alternative_name = PXE_Undefined_Vendor_Specific
-- alternative_name = PXE_Undefined
-- alternative_name = Remote_Statistics_Server_IP_Address
BOOTP_Vendor_Extensions_And_DHCP_Options_131 => 131,

-- Ref: rfc4578
-- alternative_name = PXE_Undefined_Vendor_Specific
-- alternative_name = PXE_Undefined
-- alternative_name = IEEE_802_1Q_VLAN_ID
BOOTP_Vendor_Extensions_And_DHCP_Options_132 => 132,

-- Ref: rfc4578
-- alternative_name = PXE_Undefined_Vendor_Specific
-- alternative_name = PXE_Undefined
-- alternative_name = IEEE_802_1D_P_Layer_2_Priority
BOOTP_Vendor_Extensions_And_DHCP_Options_133 => 133,

-- Ref: rfc4578
-- alternative_name = PXE_Undefined_Vendor_Specific
-- alternative_name =
-- Diffserv_Code_Point_DSCP_For_VoIP_Signalling_And_Media_Streams
-- alternative_name = PXE_Undefined
-- alternative_name = Diffserv_Code_Point
BOOTP_Vendor_Extensions_And_DHCP_Options_134 => 134,

-- Ref: rfc4578
-- alternative_name = PXE_Undefined_Vendor_Specific
-- alternative_name = PXE_Undefined
-- alternative_name = HTTP_Proxy_For_Phone_Specific_Applications
BOOTP_Vendor_Extensions_And_DHCP_Options_135 => 135,

Expand Down Expand Up @@ -733,11 +733,11 @@ package Bootp_Dhcp_Parameters is
-- description = Manufacturer Usage Descriptions
-- Ref: rfc8520
OPTION_MUD_URL_V4 => 161,
Etherboot_Tentatively_Assigned_2005_06_23 => 175,
IP_Telephone_Tentatively_Assigned_2005_06_23 => 176,
Etherboot => 175,
IP_Telephone => 176,

-- alternative_name = Etherboot_Tentatively_Assigned_2005_06_23
-- alternative_name = PacketCable_And_CableHome_Replaced_By_122
-- alternative_name = Etherboot
-- alternative_name = PacketCable_And_CableHome
BOOTP_Vendor_Extensions_And_DHCP_Options_177 => 177,

-- length = 4
Expand Down Expand Up @@ -777,7 +777,7 @@ package Bootp_Dhcp_Parameters is
Subnet_Allocation_Option => 220,

-- Ref: rfc6607
Virtual_Subnet_Selection_VSS_Option => 221,
Virtual_Subnet_Selection => 221,

-- length = 0
-- description = None
Expand Down Expand Up @@ -976,10 +976,10 @@ package Bootp_Dhcp_Parameters is
Vertical_Datum_WGS_84_Defined_By_EPSG_CRS_Code_4327 => 1,

-- Ref: rfc6225
Vertical_Datum_NAD83_Defined_By_EPSG_CRS_Code_4269_With_North_American_Vertical_Datum_Of_1988_NAVD88 => 2,
Vertical_Datum_NAD83_Defined_By_EPSG_CRS_Code_4269_With_North_American_Vertical_Datum_Of_1988 => 2,

-- Ref: rfc6225
Vertical_Datum_NAD83_Defined_By_EPSG_CRS_Code_4269_With_Mean_Lower_Low_Water_MLLW_As_Associated_Vert_3 => 3)
Vertical_Datum_NAD83_Defined_By_EPSG_CRS_Code_4269_With_Mean_Lower_Low_Water => 3)
with Size => 3;

type GeoLoc_Option_Version_Registry is
Expand Down Expand Up @@ -1065,7 +1065,7 @@ package Bootp_Dhcp_Parameters is
DHCPv4_Delayed_Authentication => 1,

-- Ref: rfc8415
DHCPv6_Delayed_Authentication_Obsolete => 2,
Obsolete_DHCPv6_Delayed_Authentication => 2,

-- Ref: rfc8415
DHCPv6_Reconfigure_Key_Authentication => 3)
Expand Down Expand Up @@ -1094,14 +1094,14 @@ package Bootp_Dhcp_Parameters is

type VSS_Type_Options is
(-- Ref: rfc6607
Network_Virtual_Terminal_NVT_ASCII_VPN_Identifier => 0,
Network_Virtual_Terminal => 0,

-- Ref: rfc2685
-- Ref: rfc6607
RFC2685_VPN_ID => 1,

-- Ref: rfc6926
All_VPNs_Wildcard => 254,
All_VPNs => 254,

-- Ref: rfc6607
Global_Default_VPN => 255)
Expand Down
10 changes: 5 additions & 5 deletions examples/specs/protocol_numbers.rflx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- AUTOMATICALLY GENERATED. DO NOT EDIT.
-- Generation date: 2022-10-05
-- Generation date: 2023-11-03
-- Protocol Numbers
-- Registry last updated on 2021-02-26

Expand Down Expand Up @@ -69,7 +69,7 @@ package Protocol_Numbers is

-- description = ARGUS
-- Ref: Robert_W_Scheifler
ARGUS_Deprecated => 13,
Deprecated_ARGUS => 13,

-- description = EMCON
-- xref = <mystery contact>
Expand Down Expand Up @@ -258,7 +258,7 @@ package Protocol_Numbers is

-- description = IP with Encryption
-- Ref: John_Ioannidis
SWIPE_Deprecated => 53,
Deprecated_SWIPE => 53,

-- description = NBMA Address Resolution Protocol
-- Ref: rfc1735
Expand Down Expand Up @@ -439,7 +439,7 @@ package Protocol_Numbers is

-- description = Mobile Internetworking Control Pro.
-- Ref: John_Ioannidis
MICP_Deprecated => 95,
Deprecated_MICP => 95,

-- description = Semaphore Communications Sec. Pro.
-- Ref: Howard_Hart
Expand Down Expand Up @@ -550,7 +550,7 @@ package Protocol_Numbers is
-- description = Simple Multicast Protocol
-- Ref: Jon_Crowcroft
-- Ref: draft-perlman-simple-multicast
SM_Deprecated => 122,
Deprecated_SM => 122,

-- description = Performance Transparency Protocol
-- Ref: Michael_Welzl
Expand Down
8 changes: 4 additions & 4 deletions examples/specs/tls_extensiontype_values.rflx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- AUTOMATICALLY GENERATED. DO NOT EDIT.
-- Generation date: 2023-09-10
-- Generation date: 2023-11-03
-- Transport Layer Security (TLS) Extensions
-- Registry last updated on 2023-07-13

Expand Down Expand Up @@ -74,7 +74,7 @@ package Tls_Extensiontype_Values is
-- rec = Y
-- Ref: rfc8422
-- Ref: rfc7919
Supported_Groups_Renamed_From_Elliptic_Curves => 10,
Supported_Groups => 10,

-- tls13 = -
-- dtls-only = N
Expand Down Expand Up @@ -225,7 +225,7 @@ package Tls_Extensiontype_Values is
-- rec = Y
-- Ref: rfc5077
-- Ref: rfc8447
Session_Ticket_Renamed_From_SessionTicket_TLS => 35,
Session_Ticket => 35,

-- tls13 = -
-- dtls-only = N
Expand Down Expand Up @@ -321,7 +321,7 @@ package Tls_Extensiontype_Values is
-- dtls-only = Y
-- rec = N
-- Ref: rfc9146
Connection_Id_Deprecated => 53,
Deprecated_Connection_Id => 53,

-- tls13 = CH, SH
-- dtls-only = Y
Expand Down
20 changes: 10 additions & 10 deletions examples/specs/tls_handshake.rflx
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ package TLS_Handshake is
Tag /= Tls_Extensiontype_Values::Token_Binding and
Tag /= Tls_Extensiontype_Values::Cached_Info and
Tag /= Tls_Extensiontype_Values::Tls_Lts and
Tag /= Tls_Extensiontype_Values::Session_Ticket_Renamed_From_SessionTicket_TLS and
Tag /= Tls_Extensiontype_Values::Session_Ticket and
Tag /= Tls_Extensiontype_Values::TLMSP and
Tag /= Tls_Extensiontype_Values::TLMSP_Proxying and
Tag /= Tls_Extensiontype_Values::TLMSP_Delegate and
Tag /= Tls_Extensiontype_Values::Oid_Filters and
Tag /= Tls_Extensiontype_Values::Connection_Id_Deprecated and
Tag /= Tls_Extensiontype_Values::Deprecated_Connection_Id and
Tag /= Tls_Extensiontype_Values::Connection_Id and
Tag /= Tls_Extensiontype_Values::Sequence_Number_Encryption_Algorithms and
Tag /= Tls_Extensiontype_Values::Renegotiation_Info
Expand Down Expand Up @@ -167,12 +167,12 @@ package TLS_Handshake is
Tag /= Tls_Extensiontype_Values::Token_Binding and
Tag /= Tls_Extensiontype_Values::Cached_Info and
Tag /= Tls_Extensiontype_Values::Tls_Lts and
Tag /= Tls_Extensiontype_Values::Session_Ticket_Renamed_From_SessionTicket_TLS and
Tag /= Tls_Extensiontype_Values::Session_Ticket and
Tag /= Tls_Extensiontype_Values::TLMSP and
Tag /= Tls_Extensiontype_Values::TLMSP_Proxying and
Tag /= Tls_Extensiontype_Values::TLMSP_Delegate and
Tag /= Tls_Extensiontype_Values::Oid_Filters and
Tag /= Tls_Extensiontype_Values::Connection_Id_Deprecated and
Tag /= Tls_Extensiontype_Values::Deprecated_Connection_Id and
Tag /= Tls_Extensiontype_Values::Renegotiation_Info
);
Data_Length : Data_Length;
Expand Down Expand Up @@ -317,7 +317,7 @@ package TLS_Handshake is
--
Tag = Tls_Extensiontype_Values::Server_Name or
Tag = Tls_Extensiontype_Values::Max_Fragment_Length or
Tag = Tls_Extensiontype_Values::Supported_Groups_Renamed_From_Elliptic_Curves or
Tag = Tls_Extensiontype_Values::Supported_Groups or
Tag = Tls_Extensiontype_Values::Use_Srtp or
Tag = Tls_Extensiontype_Values::Heartbeat or
Tag = Tls_Extensiontype_Values::Application_Layer_Protocol_Negotiation or
Expand Down Expand Up @@ -821,10 +821,10 @@ package TLS_Handshake is
end message;

for TLS_Handshake use (Payload => New_Session_Ticket)
if Tag = TLS_Parameters::New_Session_Ticket_Renamed_From_NewSessionTicket;
if Tag = TLS_Parameters::New_Session_Ticket;

for DTLS_Handshake use (Payload => New_Session_Ticket)
if Tag = TLS_Parameters::New_Session_Ticket_Renamed_From_NewSessionTicket;
if Tag = TLS_Parameters::New_Session_Ticket;

type Key_Update_Request is (
Update_Not_Requested => 0,
Expand Down Expand Up @@ -1062,11 +1062,11 @@ package TLS_Handshake is
end message;

for CH_Extension_TLS use (Data => Supported_Groups)
if Tag = TLS_ExtensionType_Values::Supported_Groups_Renamed_From_Elliptic_Curves;
if Tag = TLS_ExtensionType_Values::Supported_Groups;
for CH_Extension_DTLS use (Data => Supported_Groups)
if Tag = TLS_ExtensionType_Values::Supported_Groups_Renamed_From_Elliptic_Curves;
if Tag = TLS_ExtensionType_Values::Supported_Groups;
for EE_Extension use (Data => Supported_Groups)
if Tag = TLS_ExtensionType_Values::Supported_Groups_Renamed_From_Elliptic_Curves;
if Tag = TLS_ExtensionType_Values::Supported_Groups;

-- Key Share Extension

Expand Down
6 changes: 3 additions & 3 deletions examples/specs/tls_parameters.rflx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- AUTOMATICALLY GENERATED. DO NOT EDIT.
-- Generation date: 2023-08-24
-- Generation date: 2023-11-03
-- Transport Layer Security (TLS) Parameters
-- Registry last updated on 2023-07-19

Expand Down Expand Up @@ -1989,7 +1989,7 @@ package Tls_Parameters is
-- Ref: rfc4507
-- Ref: rfc8446
-- Ref: rfc8447
New_Session_Ticket_Renamed_From_NewSessionTicket => 4,
New_Session_Ticket => 4,

-- dtls = Y
-- Ref: rfc8446
Expand Down Expand Up @@ -2287,7 +2287,7 @@ package Tls_Parameters is
-- dtls = Y
-- rec = N
-- Ref: draft-kwiatkowski-tls-ecdhe-kyber-01
-- comment = Combining Secp256r1 ECDH with pre-standards version of Kyber768
-- comment = Combining secp256r1 ECDH with pre-standards version of Kyber768
SecP256r1Kyber768Draft00 => 25498,

-- dtls = Y
Expand Down
Loading

0 comments on commit 2219e75

Please sign in to comment.