Ignore:
Timestamp:
2012-04-20T07:32:57Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
097f421
Parents:
90f067d9 (diff), 606c369 (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/inet/iplink_srv.h

    r90f067d9 ra7a7f8c  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2012 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2828
    2929/** @addtogroup libc
    30  *  @{
     30 * @{
     31 */
     32/** @file
    3133 */
    3234
    33 /** @file
    34  * Character string with measured length.
    35  * The structure has been designed for serialization of character strings
    36  * between modules.
    37  */
     35#ifndef LIBC_INET_IPLINK_SRV_H_
     36#define LIBC_INET_IPLINK_SRV_H_
    3837
    39 #ifndef LIBC_MEASURED_STRINGS_H_
    40 #define LIBC_MEASURED_STRINGS_H_
     38#include <async.h>
     39#include <fibril_synch.h>
     40#include <bool.h>
     41#include <sys/types.h>
    4142
    42 #include <sys/types.h>
    43 #include <async.h>
     43struct iplink_ops;
    4444
    45 /** Type definition of the character string with measured length.
    46  * @see measured_string
    47  */
    48 typedef struct measured_string measured_string_t;
     45typedef struct {
     46        fibril_mutex_t lock;
     47        bool connected;
     48        struct iplink_ops *ops;
     49        void *arg;
     50        async_sess_t *client_sess;
     51} iplink_srv_t;
    4952
    50 /** Character string with measured length.
    51  *
    52  * This structure has been designed for serialization of character strings
    53  * between modules.
    54  */
    55 struct measured_string {
    56         /** Character string data. */
    57         uint8_t *value;
    58         /** Character string length. */
    59         size_t length;
    60 };
     53typedef struct {
     54        uint32_t ipv4;
     55} iplink_srv_addr_t;
    6156
    62 extern measured_string_t *measured_string_create_bulk(const uint8_t *, size_t);
    63 extern measured_string_t *measured_string_copy(measured_string_t *);
     57/** IP link Service Data Unit */
     58typedef struct {
     59        /** Local source address */
     60        iplink_srv_addr_t lsrc;
     61        /** Local destination address */
     62        iplink_srv_addr_t ldest;
     63        /** Serialized IP packet */
     64        void *data;
     65        /** Size of @c data in bytes */
     66        size_t size;
     67} iplink_srv_sdu_t;
    6468
    65 extern int measured_strings_receive(measured_string_t **, uint8_t **, size_t);
    66 extern int measured_strings_reply(const measured_string_t *, size_t);
     69typedef struct iplink_ops {
     70        int (*open)(iplink_srv_t *);
     71        int (*close)(iplink_srv_t *);
     72        int (*send)(iplink_srv_t *, iplink_srv_sdu_t *);
     73        int (*get_mtu)(iplink_srv_t *, size_t *);
     74        int (*addr_add)(iplink_srv_t *, iplink_srv_addr_t *);
     75        int (*addr_remove)(iplink_srv_t *, iplink_srv_addr_t *);
     76} iplink_ops_t;
    6777
    68 extern int measured_strings_return(async_exch_t *, measured_string_t **,
    69     uint8_t **, size_t);
    70 extern int measured_strings_send(async_exch_t *, const measured_string_t *,
    71     size_t);
     78extern void iplink_srv_init(iplink_srv_t *);
     79
     80extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *);
     81extern int iplink_ev_recv(iplink_srv_t *, iplink_srv_sdu_t *);
    7282
    7383#endif
Note: See TracChangeset for help on using the changeset viewer.