Changeset 779541b in mainline for uspace/lib/c/include
- Timestamp:
- 2015-05-09T13:43:50Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d4b815
- Parents:
- 99ea91b2
- Location:
- uspace/lib/c/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/inet/tcp.h
r99ea91b2 r779541b 36 36 #define LIBC_INET_TCP_H_ 37 37 38 #include <fibril_synch.h> 38 39 #include <inet/addr.h> 39 40 #include <inet/endpoint.h> 40 41 #include <inet/inet.h> 41 42 43 /** TCP connection */ 42 44 typedef struct { 45 fibril_mutex_t lock; 46 fibril_condvar_t cv; 47 struct tcp *tcp; 48 link_t ltcp; 49 sysarg_t id; 50 struct tcp_cb *cb; 51 void *cb_arg; 52 /** Some received data available in TCP server */ 53 bool data_avail; 43 54 } tcp_conn_t; 44 55 56 /** TCP connection listener */ 45 57 typedef struct { 58 struct tcp *tcp; 59 link_t ltcp; 60 sysarg_t id; 61 struct tcp_listen_cb *lcb; 62 void *lcb_arg; 63 struct tcp_cb *cb; 64 void *cb_arg; 46 65 } tcp_listener_t; 47 66 48 typedef struct { 67 /** TCP connection callbacks */ 68 typedef struct tcp_cb { 49 69 void (*connected)(tcp_conn_t *); 50 70 void (*conn_failed)(tcp_conn_t *); … … 54 74 } tcp_cb_t; 55 75 56 typedef struct { 76 /** TCP listener callbacks */ 77 typedef struct tcp_listen_cb { 57 78 void (*new_conn)(tcp_listener_t *, tcp_conn_t *); 58 79 } tcp_listen_cb_t; 59 80 60 typedef struct { 81 /** TCP service */ 82 typedef struct tcp { 83 /** TCP session */ 84 async_sess_t *sess; 85 /** List of connections */ 86 list_t conn; /* of tcp_conn_t */ 87 /** List of listeners */ 88 list_t listener; /* of tcp_listener_t */ 61 89 } tcp_t; 62 90 … … 76 104 extern int tcp_conn_send_fin(tcp_conn_t *); 77 105 extern int tcp_conn_push(tcp_conn_t *); 78 extern voidtcp_conn_reset(tcp_conn_t *);106 extern int tcp_conn_reset(tcp_conn_t *); 79 107 80 108 extern int tcp_conn_recv(tcp_conn_t *, void *, size_t, size_t *); -
uspace/lib/c/include/inet/udp.h
r99ea91b2 r779541b 41 41 #include <inet/inet.h> 42 42 43 /** UDP link state */ 43 44 typedef enum { 44 45 udp_ls_down, … … 46 47 } udp_link_state_t; 47 48 49 /** UDP received message */ 48 50 typedef struct { 49 51 struct udp *udp; … … 53 55 } udp_rmsg_t; 54 56 57 /** UDP received error */ 55 58 typedef struct { 56 59 } udp_rerr_t; 57 60 61 /** UDP association */ 58 62 typedef struct { 59 63 struct udp *udp; … … 64 68 } udp_assoc_t; 65 69 70 /** UDP callbacks */ 66 71 typedef struct udp_cb { 67 72 void (*recv_msg)(udp_assoc_t *, udp_rmsg_t *); … … 70 75 } udp_cb_t; 71 76 77 /** UDP service */ 72 78 typedef struct udp { 73 79 /** UDP session */ -
uspace/lib/c/include/ipc/tcp.h
r99ea91b2 r779541b 39 39 40 40 typedef enum { 41 TCP_CONN_CREATE = IPC_FIRST_USER_METHOD, 41 TCP_CALLBACK_CREATE = IPC_FIRST_USER_METHOD, 42 TCP_CONN_CREATE, 42 43 TCP_CONN_DESTROY, 43 44 TCP_LISTENER_CREATE, … … 47 48 TCP_CONN_PUSH, 48 49 TCP_CONN_RESET, 49 TCP_CONN_RECV 50 TCP_CONN_RECV, 51 TCP_CONN_RECV_WAIT 50 52 } tcp_request_t; 51 53 52 54 typedef enum { 53 TCP_ CONNECTED = IPC_FIRST_USER_METHOD54 TCP_ CONN_FAILED,55 TCP_ CONN_RESET,56 TCP_ DATA_AVAIL,57 TCP_ URG_DATA58 } tcp_ notif_t;55 TCP_EV_CONNECTED = IPC_FIRST_USER_METHOD, 56 TCP_EV_CONN_FAILED, 57 TCP_EV_CONN_RESET, 58 TCP_EV_DATA, 59 TCP_EV_URG_DATA 60 } tcp_event_t; 59 61 60 62 typedef enum { 61 TCP_ NEW_CONN = IPC_FIRST_USER_METHOD62 } tcp_listen_ cb_t;63 TCP_LEV_NEW_CONN = IPC_FIRST_USER_METHOD 64 } tcp_listen_event_t; 63 65 64 66 #endif
Note:
See TracChangeset
for help on using the changeset viewer.