Changeset c6588ce in mainline for uspace/srv/net/inet/inet_std.h


Ignore:
Timestamp:
2012-05-05T08:12:17Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ee04c28
Parents:
2cc7f16 (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/inet_std.h

    r2cc7f16 rc6588ce  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2012 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libc
     29/** @addtogroup inet
    3030 * @{
    3131 */
    32 
    33 /** @file
    34  * ARP module messages.
    35  * @see arp_interface.h
     32/**
     33 * @file IP header definitions
     34 *
    3635 */
    3736
    38 #ifndef LIBC_ARP_MESSAGES_
    39 #define LIBC_ARP_MESSAGES_
     37#ifndef INET_STD_H_
     38#define INET_STD_H_
    4039
    41 #include <ipc/net.h>
     40#include <sys/types.h>
    4241
    43 /** ARP module messages. */
    44 typedef enum {
    45         /** Clean cache message.
    46          * @see arp_clean_cache()
    47         */
    48         NET_ARP_CLEAN_CACHE = NET_ARP_FIRST,
    49         /** Clear address cache message.
    50          * @see arp_clear_address_msg()
    51         */
    52         NET_ARP_CLEAR_ADDRESS,
    53         /** Clear device cache message.
    54          * @see arp_clear_device_req()
    55         */
    56         NET_ARP_CLEAR_DEVICE,
    57         /** New device message.
    58          * @see arp_device_req()
    59         */
    60         NET_ARP_DEVICE,
    61         /** Address translation message.
    62          * @see arp_translate_req()
    63         */
    64         NET_ARP_TRANSLATE
    65 } arp_messages;
     42/** Internet Datagram header (fixed part) */
     43typedef struct {
     44        /** Version, Internet Header Length */
     45        uint8_t ver_ihl;
     46        /* Type of Service */
     47        uint8_t tos;
     48        /** Total Length */
     49        uint16_t tot_len;
     50        /** Identification */
     51        uint16_t id;
     52        /** Flags, Fragment Offset */
     53        uint16_t flags_foff;
     54        /** Time to Live */
     55        uint8_t ttl;
     56        /** Protocol */
     57        uint8_t proto;
     58        /** Header Checksum */
     59        uint16_t chksum;
     60        /** Source Address */
     61        uint32_t src_addr;
     62        /** Destination Address */
     63        uint32_t dest_addr;
     64} ip_header_t;
    6665
    67 /** @name ARP specific message parameters definitions */
    68 /*@{*/
     66/** Bits in ip_header_t.ver_ihl */
     67enum ver_ihl_bits {
     68        /** Version, highest bit */
     69        VI_VERSION_h = 7,
     70        /** Version, lowest bit */
     71        VI_VERSION_l = 4,
     72        /** Internet Header Length, highest bit */
     73        VI_IHL_h     = 3,
     74        /** Internet Header Length, lowest bit */
     75        VI_IHL_l     = 0
     76};
    6977
    70 /** Return the protocol service message parameter.
    71  *
    72  * @param[in] call Message call structure.
    73  *
    74  */
    75 #define ARP_GET_NETIF(call) ((services_t) IPC_GET_ARG2(call))
     78/** Bits in ip_header_t.flags_foff */
     79enum flags_foff_bits {
     80        /** Reserved, must be zero */
     81        FF_FLAG_RSVD = 15,
     82        /** Don't Fragment */
     83        FF_FLAG_DF = 14,
     84        /** More Fragments */
     85        FF_FLAG_MF = 13,
     86        /** Fragment Offset, highest bit */
     87        FF_FRAGOFF_h = 12,
     88        /** Fragment Offset, lowest bit */
     89        FF_FRAGOFF_l = 0
     90};
    7691
    77 /*@}*/
     92/** Fragment offset is expressed in units of 8 bytes */
     93#define FRAG_OFFS_UNIT 8
    7894
    7995#endif
Note: See TracChangeset for help on using the changeset viewer.