Changeset f2b3d3e in mainline for uspace/srv/net/inet/icmp_std.h


Ignore:
Timestamp:
2012-05-04T10:57:48Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
35a35651
Parents:
90924df (diff), d21e935c (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 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inet/icmp_std.h

    r90924df rf2b3d3e  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2012 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup udp
     29/** @addtogroup inet
    3030 * @{
    3131 */
    32 
    33 /** @file
    34  * UDP header definition.
    35  * Based on the RFC 768.
     32/**
     33 * @file ICMP standard definitions
     34 *
    3635 */
    3736
    38 #ifndef NET_UDP_HEADER_H_
    39 #define NET_UDP_HEADER_H_
     37#ifndef ICMP_STD_H_
     38#define ICMP_STD_H_
    4039
    4140#include <sys/types.h>
    4241
    43 /** UDP header size in bytes. */
    44 #define UDP_HEADER_SIZE         sizeof(udp_header_t)
     42#define IP_PROTO_ICMP 1
    4543
    46 /** Type definition of the user datagram header.
    47  * @see udp_header
    48  */
    49 typedef struct udp_header udp_header_t;
     44/** Type of service used for ICMP */
     45#define ICMP_TOS        0
    5046
    51 /** User datagram header. */
    52 struct udp_header {
    53         uint16_t source_port;
    54         uint16_t destination_port;
    55         uint16_t total_length;
     47/** ICMP message type */
     48enum icmp_type {
     49        ICMP_ECHO_REPLY   = 0,
     50        ICMP_ECHO_REQUEST = 8
     51};
     52
     53/** ICMP Echo Request or Reply message header */
     54typedef struct {
     55        /** ICMP message type */
     56        uint8_t type;
     57        /** Code (0) */
     58        uint8_t code;
     59        /** Internet checksum of the ICMP message */
    5660        uint16_t checksum;
    57 } __attribute__ ((packed));
     61        /** Indentifier */
     62        uint16_t ident;
     63        /** Sequence number */
     64        uint16_t seq_no;
     65} icmp_echo_t;
    5866
    5967#endif
Note: See TracChangeset for help on using the changeset viewer.