2.2.17 TRANS_USERDATA_HEADER

The TRANS_USERDATA_HEADER is a transport packet header that contains command, control, and ACK information. It is included with all TRANS_USERDATA DirectPlay packets.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

bCommand

bControl

bSeq

bNRcv

dwSACKMask1 (optional)

dwSACKMask2 (optional)

dwSendMask1 (optional)

dwSendMask2 (optional)

payload (variable)

...

bCommand (1 byte): An 8-bit integer that specifies characteristics of the message. Two or more of the following flags can be combined to form complex values.

Note The PACKET_COMMAND_USER1 flag SHOULD be set on all TRANS_USERDATA messages except the TRANS_USERDATA_END_OF_STREAM, TRANS_USERDATA_KEEPALIVE, and TRANS_USERDATA_SEND_MESSAGE messages.

Value

Meaning

PACKET_COMMAND_DATA

0x01

The frame contains user data.

PACKET_COMMAND_RELIABLE

0x02

The frame SHOULD be delivered reliably and requires a packet acknowledgment.

PACKET_COMMAND_SEQUENTIAL

0x04

The frame SHOULD be indicated sequentially.

PACKET_COMMAND_POLL

0x08

The partner SHOULD acknowledge immediately.

PACKET_COMMAND_NEW_MSG

0x10

The DFRAME is first in the message.

PACKET_COMMAND_END_MSG

0x20

The DFRAME is last in the message.

PACKET_COMMAND_USER_1

0x40

The first user-controlled flag. (Indicates that the payload is an internal session management message.)

PACKET_COMMAND_USER_2

0x80

The second user-controlled flag. (Indicates that the payload is an internal session management message.) The PACKET_COMMAND_USER_2 flag is not used in the DirectPlay DXDiag Usage Protocol.

bControl (1 byte): An 8-bit integer that identifies the packet. Two or more of the following flags can be combined to form complex values.

Value

Meaning

PACKET_CONTROL_RETRY

0x01

Indicates if the frame is a retry for this sequence number.

PACKET_CONTROL_KEEPALIVE_OR_CORRELATE

0x02

For versions 0x00010005 and higher, this flag indicates that the frame is a keep-alive frame, and applies only to DirectX version 9.0 and later. When the version is lower than 0x00010005, this flag requests a dedicated acknowledgment from the receiver, and applies only to versions of DirectX prior to version 9.0. For information about versions, see section 1.7.

PACKET_CONTROL_COALESCE

0x04

The packet contains multiple fused packets. This flag is not supported by DirectPlay version 8.0.

PACKET_CONTROL_END_STREAM

0x08

This is the last packet in the stream; also indicates to disconnect.

PACKET_CONTROL_SACK1

0x10

The low 32 bits of the SACK mask are present in dwSACKMask1.

PACKET_CONTROL_SACK2

0x20

The high 32 bits of the SACK mask are present in dwSACKMask2.

PACKET_CONTROL_SEND1

0x40

The low 32 bits of the cancel-send mask are present in dwSendMask1.

PACKET_CONTROL_SEND2

0x80

The high 32 bits of the cancel-send mask are present in dwSendMask2.

PACKET_CONTROL_VARIABLE_MASKS

0xF0

All four packet control mask bits are present.

bSeq (1 byte): An 8-bit integer that provides the sequence number of the packet.

bNRcv (1 byte): An 8-bit integer that provides the expected sequence number of the next packet received.

dwSACKMask1 (4 bytes): The optional low 32 bits of the SACK mask in little-endian byte order. The existence of this field in the packet is dependent on the bFlags field having SACK_FLAGS_SACK_MASK1 set in the TRANS_COMMAND_HEADER packet.

dwSACKMask2 (4 bytes): The optional high 32 bits of the SACK mask in little-endian byte order. The existence of this field in the packet is dependent on bFlags field having SACK_FLAGS_SACK_MASK2 set in the TRANS_COMMAND_HEADER packet.

dwSendMask1 (4 bytes): The optional low 32 bits of the send mask in little-endian byte order. The existence of this field in the packet is dependent on bFlags field having SACK_FLAGS_SEND_MASK1 set in the TRANS_COMMAND_HEADER packet.

dwSendMask2 (4 bytes): The optional high 32 bits of the send mask in little-endian byte order. The existence of this field in the packet is dependent on bFlags field having SACK_FLAGS_SEND_MASK2 set in the TRANS_COMMAND_HEADER packet.

payload (variable): A variable length integer that contains the consumer payload data for the packet. The payload size is the total UDP frame size minus the amount of data consumed by DFRAME headers up to this point. If the PACKET_CONTROL_COALESCE flag is set, the payload is not a single message or portion of a message, but is instead organized according to the coalesced payload format, as specified in section 2.2.17.1.