xref: /aosp_15_r20/tools/netsim/pdl/arp.pdl (revision cf78ab8cffb8fc9207af348f23af247fb04370a6)
1// PDL grammar file for arp packet format.
2
3big_endian_packets
4
5// Arp packet for Ethernet and IPv4
6
7packet ArpPacket {
8  _fixed_ = 0x01 : 16,          // Hardware type (e.g., 1 for Ethernet)
9  _fixed_ = 0x0800 : 16,        // Protocol type (e.g., 0x0800 for IPv4)
10  _fixed_ = 0x06 : 8,           // Hardware address length (e.g., 6 for MAC)
11  _fixed_ = 0x04 : 8,           // Protocol address length (e.g., 4 for IPv4)
12  opcode: 16,                   // Operation (1 for request, 2 for reply)
13  sender_hw_addr: 8[6],         // Sender's hardware address
14  sender_proto_addr: 8[4],      // Sender's protocol address
15  target_hw_addr: 8[6],         // Target's hardware address
16  target_proto_addr: 8[4],      // Target's protocol address
17}
18