Changeset b40bfac in mainline for uspace/srv/net/tl/udp/udp_header.h
- Timestamp:
- 2010-11-08T07:13:25Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63a1e60
- Parents:
- d70a463 (diff), 3da12d74 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/udp/udp_header.h
rd70a463 rb40bfac 28 28 29 29 /** @addtogroup udp 30 * 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * 35 * Based on the RFC~768.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 */ 45 #define UDP_HEADER_SIZE sizeof(udp_header_t) 43 /** UDP header size in bytes. */ 44 #define UDP_HEADER_SIZE sizeof(udp_header_t) 46 45 47 46 /** Type definition of the user datagram header. 48 * 47 * @see udp_header 49 48 */ 50 typedef struct udp_header 49 typedef struct udp_header udp_header_t; 51 50 52 51 /** Type definition of the user datagram header pointer. 53 * 52 * @see udp_header 54 53 */ 55 typedef udp_header_t * 54 typedef udp_header_t *udp_header_ref; 56 55 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 */ 56 /** User datagram header. */ 57 struct udp_header { 63 58 uint16_t source_port; 64 /** Destination port has a meaning within the context of a particular internet destination address.65 */66 59 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 */70 60 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 */77 61 uint16_t checksum; 78 62 } __attribute__ ((packed));
Note:
See TracChangeset
for help on using the changeset viewer.