How to Modify Protocol Parsers
Overview
The default packet parsers in Avi Vantage release 18.2.5 are called Default-Radius and Default-DHCP used for Remote Authentication Dial-In User Service (RADIUS) and Dynamic Host Configuration Protocol (DHCP) respectively. This article will show how to modify the protocol parser for RADIUS or DHCP packets in L4 DataScripts.
Although you can edit the default parsers, it is recommended to configure a new parser with the default one as template as discussed below.
Using an Existing Parser as a Template
The parser code in an existing default parser can be used as template to create the new parser.
To view the parser code,
- Navigate to Templates > Scripts > ProtocolParserScripts.
- Edit the required default parser to view the Edit ProtocolParserScript: screen. For example, Default-DHCP.
- Copy the contents from the Parser code field.
- Paste the copied contents into any text editor and modify the code as required.
Creating a New Parser
To create a new parser,
- Navigate to Templates > Scripts > ProtocolParserScripts.
- Click on Create.
- Enter a Name for the parser.
- Paste the copied Parser code.
The NewProtocolParserScript: is as shown below:
- Click on Save.
Associating the Parser to the DataScript
To associate the parser to the Datascript,
- Navigate to Templates>Scripts>DataScripts
- Click on the edit icon.
- Select the required Protocol Parser in the Edit DataScript Set: screen.
- Click on Save.
Note: If the virtual service is in the Up state, disable it, and if the virtual service is down, enable it for the new parser to take effect.