Changeset 46c20c8 in mainline for uspace/lib/c/include/net/inet.h


Ignore:
Timestamp:
2010-11-26T20:08:10Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
45df59a
Parents:
fb150d78 (diff), ffdd2b9 (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/inet.h

    rfb150d78 r46c20c8  
    11/*
    2  * Copyright (c) 2010 Jiri Svoboda
     2 * Copyright (c) 2009 Lukas Mejdrech
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup debug
    30  * @{
    31  */
    32 /** @file
     29/** @addtogroup libc
     30 *  @{
    3331 */
    3432
    35 #ifndef LIBC_ia32__ISTATE_H_
    36 #define LIBC_ia32__ISTATE_H_
     33/** @file
     34 *  Internet common definitions.
     35 */
     36
     37#ifndef LIBC_INET_H_
     38#define LIBC_INET_H_
    3739
    3840#include <sys/types.h>
     41#include <byteorder.h>
    3942
    40 /** Interrupt context.
    41  *
    42  * This is a copy of the kernel definition with which it must be kept in sync.
     43/** Type definition of the socket address.
     44 * @see sockaddr
    4345 */
    44 typedef struct istate {
    45         uint32_t eax;
    46         uint32_t ecx;
    47         uint32_t edx;
    48         uint32_t ebp;
     46typedef struct sockaddr         sockaddr_t;
    4947
    50         uint32_t gs;
    51         uint32_t fs;
    52         uint32_t es;
    53         uint32_t ds;
     48/** Type definition of the address information.
     49 * @see addrinfo
     50 */
     51typedef struct addrinfo         addrinfo_t;
    5452
    55         uint32_t error_word;
    56         uint32_t eip;
    57         uint32_t cs;
    58         uint32_t eflags;
    59         uint32_t stack[];
    60 } istate_t;
     53/** Socket address. */
     54struct sockaddr {
     55        /** Address family. @see socket.h */
     56        uint16_t sa_family;
     57        /** 14 byte protocol address. */
     58        uint8_t sa_data[14];
     59};
    6160
    62 static inline uintptr_t istate_get_pc(istate_t *istate)
    63 {
    64         return istate->eip;
    65 }
    66 
    67 static inline uintptr_t istate_get_fp(istate_t *istate)
    68 {
    69         return istate->ebp;
    70 }
     61extern int inet_ntop(uint16_t, const uint8_t *, char *, size_t);
     62extern int inet_pton(uint16_t, const char *, uint8_t *);
    7163
    7264#endif
Note: See TracChangeset for help on using the changeset viewer.