Changeset f2b3d3e in mainline for uspace/lib/c/include/inet/iplink.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/lib/c/include/inet/iplink.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 libnet
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 
    3332/** @file
    34  * Internetwork layer module interface for the underlying network interface
    35  * layer. This interface is always called by the remote modules.
    3633 */
    3734
    38 #ifndef LIBNET_IL_REMOTE_H_
    39 #define LIBNET_IL_REMOTE_H_
     35#ifndef LIBC_INET_IPLINK_H_
     36#define LIBC_INET_IPLINK_H_
    4037
    41 #include <ipc/services.h>
     38#include <async.h>
    4239#include <sys/types.h>
    43 #include <net/device.h>
    44 #include <net/packet.h>
    45 #include <async.h>
    4640
    47 /** @name Internetwork layer module interface
    48  * This interface is used by other modules.
    49  */
    50 /*@{*/
     41struct iplink_ev_ops;
    5142
    52 extern int il_device_state_msg(async_sess_t *, nic_device_id_t,
    53     nic_device_state_t, services_t);
    54 extern int il_received_msg(async_sess_t *, nic_device_id_t, packet_t *,
    55     services_t);
    56 extern int il_mtu_changed_msg(async_sess_t *, nic_device_id_t, size_t,
    57     services_t);
    58 extern int il_addr_changed_msg(async_sess_t *, nic_device_id_t, size_t,
    59     const uint8_t *);
     43typedef struct {
     44        async_sess_t *sess;
     45        struct iplink_ev_ops *ev_ops;
     46} iplink_t;
    6047
    61 /*@}*/
     48typedef struct {
     49        uint32_t ipv4;
     50} iplink_addr_t;
     51
     52/** IP link Service Data Unit */
     53typedef struct {
     54        /** Local source address */
     55        iplink_addr_t lsrc;
     56        /** Local destination address */
     57        iplink_addr_t ldest;
     58        /** Serialized IP packet */
     59        void *data;
     60        /** Size of @c data in bytes */
     61        size_t size;
     62} iplink_sdu_t;
     63
     64typedef struct iplink_ev_ops {
     65        int (*recv)(iplink_t *, iplink_sdu_t *);
     66} iplink_ev_ops_t;
     67
     68extern int iplink_open(async_sess_t *, iplink_ev_ops_t *, iplink_t **);
     69extern void iplink_close(iplink_t *);
     70extern int iplink_send(iplink_t *, iplink_sdu_t *);
     71extern int iplink_addr_add(iplink_t *, iplink_addr_t *);
     72extern int iplink_addr_remove(iplink_t *, iplink_addr_t *);
     73extern int iplink_get_mtu(iplink_t *, size_t *);
    6274
    6375#endif
Note: See TracChangeset for help on using the changeset viewer.