ethernet_frame: GraphViz block diagram (.dot) source

KS implementation details

License: CC0-1.0
Minimal Kaitai Struct required: 0.7

This page hosts a formal specification of ethernet_frame using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

GraphViz block diagram source

ethernet_frame.dot

digraph {
	rankdir=LR;
	node [shape=plaintext];
	subgraph cluster__ethernet_frame {
		label="EthernetFrame";
		graph[style=dotted];

		ethernet_frame__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
			<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
			<TR><TD PORT="dst_mac_pos">0</TD><TD PORT="dst_mac_size">6</TD><TD></TD><TD PORT="dst_mac_type">dst_mac</TD></TR>
			<TR><TD PORT="src_mac_pos">6</TD><TD PORT="src_mac_size">6</TD><TD></TD><TD PORT="src_mac_type">src_mac</TD></TR>
			<TR><TD PORT="ether_type_pos">12</TD><TD PORT="ether_type_size">2</TD><TD>u2be→EtherTypeEnum</TD><TD PORT="ether_type_type">ether_type</TD></TR>
			<TR><TD PORT="body_pos">14</TD><TD PORT="body_size">...</TD><TD>switch (ether_type)</TD><TD PORT="body_type">body</TD></TR>
		</TABLE>>];
ethernet_frame__seq_body_switch [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
	<TR><TD BGCOLOR="#F0F2E4">case</TD><TD BGCOLOR="#F0F2E4">type</TD></TR>
	<TR><TD>:ether_type_enum_ipv4</TD><TD PORT="case0">Ipv4Packet</TD></TR>
	<TR><TD>:ether_type_enum_ipv6</TD><TD PORT="case1">Ipv6Packet</TD></TR>
</TABLE>>];
	}
	ethernet_frame__seq:body_type -> ethernet_frame__seq_body_switch [style=bold];
	ethernet_frame__seq_body_switch:case0 -> ipv4_packet__seq [style=bold];
	ethernet_frame__seq_body_switch:case1 -> ipv6_packet__seq [style=bold];
	ethernet_frame__seq:ether_type_type -> ethernet_frame__seq:body_type [color="#404040"];
}