Changeset 779541b in mainline for uspace/lib/c/include/inet/tcp.h
- 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
- File:
-
- 1 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 *);
Note:
See TracChangeset
for help on using the changeset viewer.