Changes in uspace/srv/net/tl/udp/udp_header.h [457a6f5:aadf01e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/udp/udp_header.h
r457a6f5 raadf01e 28 28 29 29 /** @addtogroup udp 30 * @{30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * UDP header definition.35 * Based on the RFC768.34 * UDP header definition. 35 * Based on the RFC~768. 36 36 */ 37 37 38 #ifndef NET_UDP_HEADER_H_39 #define NET_UDP_HEADER_H_38 #ifndef __NET_UDP_HEADER_H__ 39 #define __NET_UDP_HEADER_H__ 40 40 41 41 #include <sys/types.h> 42 42 43 /** UDP header size in bytes. */ 44 #define UDP_HEADER_SIZE sizeof(udp_header_t) 43 /** UDP header size in bytes. 44 */ 45 #define UDP_HEADER_SIZE sizeof(udp_header_t) 45 46 46 47 /** Type definition of the user datagram header. 47 * @see udp_header48 * @see udp_header 48 49 */ 49 typedef struct udp_header 50 typedef struct udp_header udp_header_t; 50 51 51 52 /** Type definition of the user datagram header pointer. 52 * @see udp_header53 * @see udp_header 53 54 */ 54 typedef udp_header_t * udp_header_ref;55 typedef udp_header_t * udp_header_ref; 55 56 56 /** User datagram header. */ 57 struct udp_header { 57 /** User datagram header. 58 */ 59 struct udp_header{ 60 /** Source Port is an optional field, when meaningful, it indicates the port of the sending process, and may be assumed to be the port to which a reply should be addressed in the absence of any other information. 61 * If not used, a value of zero is inserted. 62 */ 58 63 uint16_t source_port; 64 /** Destination port has a meaning within the context of a particular internet destination address. 65 */ 59 66 uint16_t destination_port; 67 /** Length is the length in octets of this user datagram including this header and the data. 68 * This means the minimum value of the length is eight. 69 */ 60 70 uint16_t total_length; 71 /** Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets. 72 * The pseudo header conceptually prefixed to the UDP header contains the source address, the destination address, the protocol, and the UDP length. 73 * This information gives protection against misrouted datagrams. 74 * If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic). 75 * An all zero transmitted checksum value means that the transmitter generated no checksum (for debugging or for higher level protocols that don't care). 76 */ 61 77 uint16_t checksum; 62 78 } __attribute__ ((packed));
Note:
See TracChangeset
for help on using the changeset viewer.