Changeset c2a6983 in mainline for uspace/lib/c/include/inet


Ignore:
Timestamp:
2013-10-13T20:59:33Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12d6c98
Parents:
820104d (diff), 39bcc99 (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

Location:
uspace/lib/c/include/inet
Files:
1 added
7 edited

Legend:

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

    r820104d rc2a6983  
    3939#include <net/in.h>
    4040#include <net/in6.h>
     41#include <net/socket.h>
    4142
    4243typedef uint32_t addr32_t;
     
    4445typedef uint8_t addr128_t[16];
    4546
     47typedef enum {
     48        /** Any IP protocol version */
     49        ip_any,
     50        /** IPv4 */
     51        ip_v4,
     52        /** IPv6 */
     53        ip_v6
     54} ip_ver_t;
     55
    4656/** Node address */
    4757typedef struct {
    48         uint16_t family;
     58        /** IP version */
     59        ip_ver_t version;
    4960        union {
    5061                addr32_t addr;
     
    5566/** Network address */
    5667typedef struct {
    57         /** Address family */
    58         uint16_t family;
     68        /** IP version */
     69        ip_ver_t version;
    5970       
    6071        /** Address */
     
    6879} inet_naddr_t;
    6980
     81extern const addr32_t addr32_broadcast_all_hosts;
    7082extern const addr48_t addr48_broadcast;
    7183
     
    90102    uint16_t, uint16_t, uint16_t, uint16_t, uint8_t);
    91103
    92 extern int inet_addr_family(const char *, uint16_t *);
    93104extern void inet_naddr_addr(const inet_naddr_t *, inet_addr_t *);
    94105extern void inet_addr_naddr(const inet_addr_t *, uint8_t, inet_naddr_t *);
     
    109120extern int inet_naddr_format(const inet_naddr_t *, char **);
    110121
    111 extern uint16_t inet_addr_get(const inet_addr_t *, addr32_t *, addr128_t *);
    112 extern uint16_t inet_naddr_get(const inet_naddr_t *, addr32_t *, addr128_t *,
     122extern ip_ver_t inet_addr_get(const inet_addr_t *, addr32_t *, addr128_t *);
     123extern ip_ver_t inet_naddr_get(const inet_naddr_t *, addr32_t *, addr128_t *,
    113124    uint8_t *);
    114125
     
    124135    sockaddr_in6_t *);
    125136
     137extern ip_ver_t ipver_from_af(int af);
     138extern int inet_addr_sockaddr(const inet_addr_t *, uint16_t, sockaddr_t **,
     139    socklen_t *);
     140
    126141#endif
    127142
  • uspace/lib/c/include/inet/dnsr.h

    r820104d rc2a6983  
    5151
    5252extern int dnsr_init(void);
    53 extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, uint16_t);
     53extern int dnsr_name2host(const char *, dnsr_hostinfo_t **, ip_ver_t);
    5454extern void dnsr_hostinfo_destroy(dnsr_hostinfo_t *);
    5555extern int dnsr_get_srvaddr(inet_addr_t *);
  • uspace/lib/c/include/inet/inet.h

    r820104d rc2a6983  
    3737
    3838#include <inet/addr.h>
     39#include <ipc/loc.h>
    3940#include <sys/types.h>
    40 
    41 #define INET_TTL_MAX 255
    42 
    43 typedef struct {
    44         inet_addr_t src;
    45         inet_addr_t dest;
    46         uint8_t tos;
    47         void *data;
    48         size_t size;
    49 } inet_dgram_t;
    50 
    51 typedef struct {
    52         int (*recv)(inet_dgram_t *);
    53 } inet_ev_ops_t;
    54 
    55 typedef enum {
    56         INET_DF = 1
    57 } inet_df_t;
     41#include <types/inet.h>
    5842
    5943extern int inet_init(uint8_t, inet_ev_ops_t *);
  • uspace/lib/c/include/inet/inetcfg.h

    r820104d rc2a6983  
    3838#include <inet/inet.h>
    3939#include <sys/types.h>
    40 
    41 /** Address object info */
    42 typedef struct {
    43         /** Network address */
    44         inet_naddr_t naddr;
    45         /** Link service ID */
    46         sysarg_t ilink;
    47         /** Address object name */
    48         char *name;
    49 } inet_addr_info_t;
    50 
    51 /** IP link info */
    52 typedef struct {
    53         /** Link service name */
    54         char *name;
    55         /** Default MTU */
    56         size_t def_mtu;
    57 } inet_link_info_t;
    58 
    59 /** Static route info */
    60 typedef struct {
    61         /** Destination network address */
    62         inet_naddr_t dest;
    63         /** Router address */
    64         inet_addr_t router;
    65         /** Static route name */
    66         char *name;
    67 } inet_sroute_info_t;
     40#include <types/inetcfg.h>
    6841
    6942extern int inetcfg_init(void);
     
    7548extern int inetcfg_get_link_list(sysarg_t **, size_t *);
    7649extern int inetcfg_get_sroute_list(sysarg_t **, size_t *);
     50extern int inetcfg_link_add(sysarg_t);
    7751extern int inetcfg_link_get(sysarg_t, inet_link_info_t *);
     52extern int inetcfg_link_remove(sysarg_t);
    7853extern int inetcfg_sroute_get(sysarg_t, inet_sroute_info_t *);
    7954extern int inetcfg_sroute_get_id(const char *, sysarg_t *);
  • uspace/lib/c/include/inet/inetping.h

    r820104d rc2a6983  
    11/*
    2  * Copyright (c) 2012 Jiri Svoboda
     2 * Copyright (c) 2013 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3838#include <inet/inet.h>
    3939#include <sys/types.h>
    40 
    41 typedef struct {
    42         uint32_t src;
    43         uint32_t dest;
    44         uint16_t seq_no;
    45         void *data;
    46         size_t size;
    47 } inetping_sdu_t;
     40#include <types/inetping.h>
    4841
    4942typedef struct inetping_ev_ops {
     
    5346extern int inetping_init(inetping_ev_ops_t *);
    5447extern int inetping_send(inetping_sdu_t *);
    55 extern int inetping_get_srcaddr(uint32_t, uint32_t *);
     48extern int inetping_get_srcaddr(const inet_addr_t *, inet_addr_t *);
    5649
    5750#endif
  • uspace/lib/c/include/inet/iplink.h

    r820104d rc2a6983  
    3737
    3838#include <async.h>
    39 #include <sys/types.h>
    4039#include <inet/addr.h>
    4140
     
    7877
    7978typedef struct iplink_ev_ops {
    80         int (*recv)(iplink_t *, iplink_recv_sdu_t *, uint16_t);
     79        int (*recv)(iplink_t *, iplink_recv_sdu_t *, ip_ver_t);
    8180} iplink_ev_ops_t;
    8281
  • uspace/lib/c/include/inet/iplink_srv.h

    r820104d rc2a6983  
    3939#include <fibril_synch.h>
    4040#include <stdbool.h>
    41 #include <sys/types.h>
    4241#include <inet/addr.h>
    4342#include <inet/iplink.h>
     
    6766
    6867extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *);
    69 extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, uint16_t);
     68extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, ip_ver_t);
    7069
    7170#endif
Note: See TracChangeset for help on using the changeset viewer.