DIME (Direct Internet Message Encapsulation) Message: GraphViz block diagram (.dot) source

Direct Internet Message Encapsulation (DIME) is an old Microsoft specification for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages, using standard transport protocols like HTTP.

Sample file: curl -LO https://github.com/kaitai-io/kaitai_struct_formats/files/5894723/scanner_withoptions.dump.gz && gunzip scanner_withoptions.dump.gz

File extension

["dim", "dime"]

KS implementation details

License: CC0-1.0

References

This page hosts a formal specification of DIME (Direct Internet Message Encapsulation) Message using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

GraphViz block diagram source

dime_message.dot

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

		dime_message__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="records_pos">0</TD><TD PORT="records_size">...</TD><TD>Record</TD><TD PORT="records_type">records</TD></TR>
			<TR><TD COLSPAN="4" PORT="records__repeat">repeat to end of stream</TD></TR>
		</TABLE>>];
		subgraph cluster__padding {
			label="DimeMessage::Padding";
			graph[style=dotted];

			padding__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="boundary_padding_pos">0</TD><TD PORT="boundary_padding_size">(-(_io.pos) % 4)</TD><TD></TD><TD PORT="boundary_padding_type">boundary_padding</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__option_field {
			label="DimeMessage::OptionField";
			graph[style=dotted];

			option_field__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="option_elements_pos">0</TD><TD PORT="option_elements_size">...</TD><TD>OptionElement</TD><TD PORT="option_elements_type">option_elements</TD></TR>
				<TR><TD COLSPAN="4" PORT="option_elements__repeat">repeat to end of stream</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__option_element {
			label="DimeMessage::OptionElement";
			graph[style=dotted];

			option_element__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="element_format_pos">0</TD><TD PORT="element_format_size">2</TD><TD>u2be</TD><TD PORT="element_format_type">element_format</TD></TR>
				<TR><TD PORT="len_element_pos">2</TD><TD PORT="len_element_size">2</TD><TD>u2be</TD><TD PORT="len_element_type">len_element</TD></TR>
				<TR><TD PORT="element_data_pos">4</TD><TD PORT="element_data_size">len_element</TD><TD></TD><TD PORT="element_data_type">element_data</TD></TR>
			</TABLE>>];
		}
		subgraph cluster__record {
			label="DimeMessage::Record";
			graph[style=dotted];

			record__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="version_pos">0</TD><TD PORT="version_size">5b</TD><TD>b5</TD><TD PORT="version_type">version</TD></TR>
				<TR><TD PORT="is_first_record_pos">0:5</TD><TD PORT="is_first_record_size">1b</TD><TD>BitsType1(BigBitEndian)</TD><TD PORT="is_first_record_type">is_first_record</TD></TR>
				<TR><TD PORT="is_last_record_pos">0:6</TD><TD PORT="is_last_record_size">1b</TD><TD>BitsType1(BigBitEndian)</TD><TD PORT="is_last_record_type">is_last_record</TD></TR>
				<TR><TD PORT="is_chunk_record_pos">0:7</TD><TD PORT="is_chunk_record_size">1b</TD><TD>BitsType1(BigBitEndian)</TD><TD PORT="is_chunk_record_type">is_chunk_record</TD></TR>
				<TR><TD PORT="type_format_pos">1</TD><TD PORT="type_format_size">4b</TD><TD>b4→TypeFormats</TD><TD PORT="type_format_type">type_format</TD></TR>
				<TR><TD PORT="reserved_pos">1:4</TD><TD PORT="reserved_size">4b</TD><TD>b4</TD><TD PORT="reserved_type">reserved</TD></TR>
				<TR><TD PORT="len_options_pos">2</TD><TD PORT="len_options_size">2</TD><TD>u2be</TD><TD PORT="len_options_type">len_options</TD></TR>
				<TR><TD PORT="len_id_pos">4</TD><TD PORT="len_id_size">2</TD><TD>u2be</TD><TD PORT="len_id_type">len_id</TD></TR>
				<TR><TD PORT="len_type_pos">6</TD><TD PORT="len_type_size">2</TD><TD>u2be</TD><TD PORT="len_type_type">len_type</TD></TR>
				<TR><TD PORT="len_data_pos">8</TD><TD PORT="len_data_size">4</TD><TD>u4be</TD><TD PORT="len_data_type">len_data</TD></TR>
				<TR><TD PORT="options_pos">12</TD><TD PORT="options_size">len_options</TD><TD>OptionField</TD><TD PORT="options_type">options</TD></TR>
				<TR><TD PORT="options_padding_pos">...</TD><TD PORT="options_padding_size">...</TD><TD>Padding</TD><TD PORT="options_padding_type">options_padding</TD></TR>
				<TR><TD PORT="id_pos">...</TD><TD PORT="id_size">len_id</TD><TD>str(ASCII)</TD><TD PORT="id_type">id</TD></TR>
				<TR><TD PORT="id_padding_pos">...</TD><TD PORT="id_padding_size">...</TD><TD>Padding</TD><TD PORT="id_padding_type">id_padding</TD></TR>
				<TR><TD PORT="type_pos">...</TD><TD PORT="type_size">len_type</TD><TD>str(ASCII)</TD><TD PORT="type_type">type</TD></TR>
				<TR><TD PORT="type_padding_pos">...</TD><TD PORT="type_padding_size">...</TD><TD>Padding</TD><TD PORT="type_padding_type">type_padding</TD></TR>
				<TR><TD PORT="data_pos">...</TD><TD PORT="data_size">len_data</TD><TD></TD><TD PORT="data_type">data</TD></TR>
				<TR><TD PORT="data_padding_pos">...</TD><TD PORT="data_padding_size">...</TD><TD>Padding</TD><TD PORT="data_padding_type">data_padding</TD></TR>
			</TABLE>>];
		}
	}
	dime_message__seq:records_type -> record__seq [style=bold];
	option_field__seq:option_elements_type -> option_element__seq [style=bold];
	option_element__seq:len_element_type -> option_element__seq:element_data_size [color="#404040"];
	record__seq:len_options_type -> record__seq:options_size [color="#404040"];
	record__seq:options_type -> option_field__seq [style=bold];
	record__seq:options_padding_type -> padding__seq [style=bold];
	record__seq:len_id_type -> record__seq:id_size [color="#404040"];
	record__seq:id_padding_type -> padding__seq [style=bold];
	record__seq:len_type_type -> record__seq:type_size [color="#404040"];
	record__seq:type_padding_type -> padding__seq [style=bold];
	record__seq:len_data_type -> record__seq:data_size [color="#404040"];
	record__seq:data_padding_type -> padding__seq [style=bold];
}