Changeset b40bfac in mainline for uspace/srv/net/tl/udp/udp_header.h


Ignore:
Timestamp:
2010-11-08T07:13:25Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
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.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/udp/udp_header.h

    rd70a463 rb40bfac  
    2828
    2929/** @addtogroup udp
    30  *  @{
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  UDP header definition.
    35  *  Based on the RFC~768.
     34 * UDP header definition.
     35 * Based on the RFC 768.
    3636 */
    3737
    38 #ifndef __NET_UDP_HEADER_H__
    39 #define __NET_UDP_HEADER_H__
     38#ifndef NET_UDP_HEADER_H_
     39#define NET_UDP_HEADER_H_
    4040
    4141#include <sys/types.h>
    4242
    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)
    4645
    4746/** Type definition of the user datagram header.
    48  *  @see udp_header
     47 * @see udp_header
    4948 */
    50 typedef struct udp_header       udp_header_t;
     49typedef struct udp_header udp_header_t;
    5150
    5251/** Type definition of the user datagram header pointer.
    53  *  @see udp_header
     52 * @see udp_header
    5453 */
    55 typedef udp_header_t *          udp_header_ref;
     54typedef udp_header_t *udp_header_ref;
    5655
    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. */
     57struct udp_header {
    6358        uint16_t source_port;
    64         /** Destination port has a meaning within the context of a particular internet destination address.
    65          */
    6659        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          */
    7060        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          */
    7761        uint16_t checksum;
    7862} __attribute__ ((packed));
Note: See TracChangeset for help on using the changeset viewer.