Changeset 0c37135 in mainline for uspace/lib/c/include/inet/iplink.h


Ignore:
Timestamp:
2012-04-18T07:32:58Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5f67cd61
Parents:
3d93289a (diff), 63920b0 (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 with mainline

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/inet/iplink.h

    r3d93289a r0c37135  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2012 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libnet
    30  *  @{
     29/** @addtogroup libc
     30 * @{
     31 */
     32/** @file
    3133 */
    3234
    33 #ifndef LIBNET_ICMP_REMOTE_H_
    34 #define LIBNET_ICMP_REMOTE_H_
     35#ifndef LIBC_INET_IPLINK_H_
     36#define LIBC_INET_IPLINK_H_
    3537
    36 #include <net/socket_codes.h>
     38#include <async.h>
    3739#include <sys/types.h>
    38 #include <net/device.h>
    39 #include <adt/measured_strings.h>
    40 #include <net/packet.h>
    41 #include <net/inet.h>
    42 #include <net/ip_codes.h>
    43 #include <net/icmp_codes.h>
    44 #include <net/icmp_common.h>
    45 #include <async.h>
    4640
    47 /** @name ICMP module interface
    48  * This interface is used by other modules.
    49  */
    50 /*@{*/
     41struct iplink_ev_ops;
    5142
    52 extern int icmp_destination_unreachable_msg(async_sess_t *, icmp_code_t,
    53     icmp_param_t, packet_t *);
    54 extern int icmp_source_quench_msg(async_sess_t *, packet_t *);
    55 extern int icmp_time_exceeded_msg(async_sess_t *, icmp_code_t, packet_t *);
    56 extern int icmp_parameter_problem_msg(async_sess_t *, icmp_code_t, icmp_param_t,
    57     packet_t *);
     43typedef struct {
     44        async_sess_t *sess;
     45        struct iplink_ev_ops *ev_ops;
     46} iplink_t;
    5847
    59 /*@}*/
     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 *);
    6074
    6175#endif
Note: See TracChangeset for help on using the changeset viewer.