Module S.PDU

type pdu =
| Layer2 of layer2_pdu
| Layer3 of layer3_pdu
| Layer4 of layer4_pdu
and layer2_pdu =
| Ether of ether_frame
and ether_frame =
| Ether_frame of {
header : Ether.ether_header;
payload : ether_payload;
}
and ether_payload =
| Ether_payload_raw of Ether.ether_payload_raw
| Ether_payload_encap of layer3_pdu
and layer3_pdu =
| IPv4 of ipv4_pkt
| IPv6 of ipv6_pkt
and ipv4_pkt =
| IPv4_pkt of {
header : IPv4.ipv4_header;
payload : ipv4_payload;
}
and ipv6_pkt =
| IPv6_pkt of {
header : IPv6.ipv6_header;
payload : ipv6_payload;
}
and icmpv4_pkt =
| ICMPv4_pkt of {
header : ICMPv4.icmpv4_header;
payload : icmpv4_payload;
}
and icmpv6_pkt =
| ICMPv6_pkt of {
header : ICMPv6.icmpv6_header;
payload : icmpv6_payload;
}
and ipv4_payload =
| IPv4_payload_raw of IPv4.ipv4_payload_raw
| IPv4_payload_icmp of icmpv4_pkt
| IPv4_payload_encap of layer4_pdu
and ipv6_payload =
| IPv6_payload_raw of IPv6.ipv6_payload_raw
| IPv6_payload_icmp of icmpv6_pkt
| IPv6_payload_encap of layer4_pdu
and icmpv4_payload =
| ICMPv4_payload_raw of ICMPv4.icmpv4_payload_raw
and icmpv6_payload =
| ICMPv6_payload_raw of ICMPv6.icmpv6_payload_raw
and layer4_pdu =
| TCP of tcp_pdu
| UDP of udp_pdu
and tcp_pdu =
| TCP_pdu of {
header : TCP.tcp_header;
payload : tcp_payload;
}
and udp_pdu =
| UDP_pdu of {
header : UDP.udp_header;
payload : udp_payload;
}
and tcp_payload =
| TCP_payload_raw of TCP.tcp_payload_raw
and udp_payload =
| UDP_payload_raw of UDP.udp_payload_raw