Changeset 97c7682 in mainline for uspace/lib/c/include/inet/iplink_srv.h
- Timestamp:
- 2012-07-14T11:18:40Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 804d9b6
- Parents:
- 0747468 (diff), f0348c8 (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/inet/iplink_srv.h
r0747468 r97c7682 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2012 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 28 28 29 29 /** @addtogroup libc 30 * @{ 30 * @{ 31 */ 32 /** @file 31 33 */ 32 34 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_ 38 37 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> 41 42 42 #include <sys/types.h> 43 #include <async.h> 43 struct iplink_ops; 44 44 45 /** Type definition of the character string with measured length. 46 * @see measured_string 47 */ 48 typedef struct measured_string measured_string_t; 45 typedef 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; 49 52 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 }; 53 typedef struct { 54 uint32_t ipv4; 55 } iplink_srv_addr_t; 61 56 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 */ 58 typedef 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; 64 68 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); 69 typedef 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; 67 77 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);78 extern void iplink_srv_init(iplink_srv_t *); 79 80 extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *); 81 extern int iplink_ev_recv(iplink_srv_t *, iplink_srv_sdu_t *); 72 82 73 83 #endif
Note:
See TracChangeset
for help on using the changeset viewer.