Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (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/lib/c/include/net/socket_codes.h

    rcefb126 r89c57b6  
    2727 */
    2828
    29 /** @addtogroup arp
     29/** @addtogroup libc
    3030 *  @{
    3131 */
    3232
    3333/** @file
    34  *  ARP protocol header.
    35  *  Based on the RFC~826.
     34 *  Socket codes and definitions.
     35 *  This is a part of the network application library.
    3636 */
    3737
    38 #ifndef __NET_ARP_HEADER_H__
    39 #define __NET_ARP_HEADER_H__
     38#ifndef LIBC_SOCKET_CODES_H_
     39#define LIBC_SOCKET_CODES_H_
    4040
    4141#include <sys/types.h>
    4242
    43 /** Type definition of an ARP protocol header.
    44  *  @see arp_header
     43/** @name Address families definitions */
     44/*@{*/
     45
     46enum {
     47        AF_UNKNOWN = 0,
     48        AF_INET,        /* IPv4 address */
     49        AF_INET6        /* IPv6 address */
     50};
     51
     52/*@}*/
     53
     54/** @name Protocol families definitions
     55 *  Same as address families.
    4556 */
    46 typedef struct arp_header       arp_header_t;
     57/*@{*/
    4758
    48 /** Type definition of an ARP protocol header pointer.
    49  *  @see arp_header
    50  */
    51 typedef arp_header_t *          arp_header_ref;
     59#define PF_INET         AF_INET
     60#define PF_INET6        AF_INET6
    5261
    53 /** ARP protocol header.
    54  */
    55 struct arp_header{
    56         /** Hardware type identifier.
    57          *  @see hardware.h
    58          */
    59         uint16_t hardware;
    60         /** Protocol identifier.
    61          */
    62         uint16_t protocol;
    63         /** Hardware address length in bytes.
    64          */
    65         uint8_t hardware_length;
    66         /** Protocol address length in bytes.
    67          */
    68         uint8_t protocol_length;
    69         /** ARP packet type.
    70          *  @see arp_oc.h
    71          */
    72         uint16_t operation;
    73 } __attribute__ ((packed));
     62/*@}*/
     63
     64/** Socket types. */
     65typedef enum sock_type {
     66        /** Stream (connection oriented) socket. */
     67        SOCK_STREAM = 1,
     68        /** Datagram (connectionless oriented) socket. */
     69        SOCK_DGRAM = 2,
     70        /** Raw socket. */
     71        SOCK_RAW = 3
     72} sock_type_t;
     73
     74/** Type definition of the socket length. */
     75typedef int32_t socklen_t;
    7476
    7577#endif
Note: See TracChangeset for help on using the changeset viewer.