Changeset 2f19103 in mainline for uspace/srv/net/tcp/tcp_type.h
- Timestamp:
- 2015-05-22T07:21:37Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 58e9dec
- Parents:
- bf7587b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/tcp_type.h
rbf7587b0 r2f19103 1 1 /* 2 * Copyright (c) 201 1Jiri Svoboda2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 43 43 #include <sys/types.h> 44 44 #include <inet/addr.h> 45 #include <inet/endpoint.h> 45 46 46 47 struct tcp_conn; … … 89 90 /* Connection reset */ 90 91 TCP_ERESET, 91 /* Foreign socket unspecified */92 /* Remote endpoint unspecified */ 92 93 TCP_EUNSPEC, 93 94 /* Insufficient resources */ … … 112 113 } tcp_control_t; 113 114 114 typedef struct {115 inet_addr_t addr;116 uint16_t port;117 } tcp_sock_t;118 119 115 enum tcp_port { 120 116 TCP_PORT_ANY = 0 121 117 }; 122 123 typedef struct {124 tcp_sock_t local;125 tcp_sock_t foreign;126 } tcp_sockpair_t;127 118 128 119 /** Connection incoming segments queue */ … … 171 162 void *cb_arg; 172 163 173 /** Connection identification (local and foreign socket) */174 tcp_sockpair_t ident;164 /** Connection identification (local and remote endpoint) */ 165 inet_ep2_t ident; 175 166 176 167 /** Active or passive connection */ … … 280 271 typedef struct { 281 272 link_t link; 282 tcp_sockpair_t sp;273 inet_ep2_t epp; 283 274 tcp_segment_t *seg; 284 275 } tcp_rqueue_entry_t; … … 288 279 link_t link; 289 280 suseconds_t delay; 290 tcp_sockpair_t sp;281 inet_ep2_t epp; 291 282 tcp_segment_t *seg; 292 283 } tcp_squeue_entry_t; … … 339 330 typedef struct tcp_clst { 340 331 /** Local endpoint */ 341 tcp_sock_t elocal;332 inet_ep_t elocal; 342 333 /** Connection */ 343 334 tcp_conn_t *conn; … … 360 351 } tcp_client_t; 361 352 362 #define TCP_SOCK_FRAGMENT_SIZE 1024363 364 typedef struct tcp_sockdata {365 /** Lock */366 fibril_mutex_t lock;367 /** Socket core */368 // socket_core_t *sock_core;369 /** Client */370 tcp_client_t *client;371 /** Connection */372 tcp_conn_t *conn;373 /** Local address */374 inet_addr_t laddr;375 /** Backlog size */376 int backlog;377 /** Array of listening connections, @c backlog elements */378 struct tcp_sock_lconn **lconn;379 /** List of connections (from lconn) that are ready to be accepted */380 list_t ready;381 /** Receiving fibril */382 fid_t recv_fibril;383 uint8_t recv_buffer[TCP_SOCK_FRAGMENT_SIZE];384 size_t recv_buffer_used;385 fibril_mutex_t recv_buffer_lock;386 fibril_condvar_t recv_buffer_cv;387 tcp_error_t recv_error;388 } tcp_sockdata_t;389 390 typedef struct tcp_sock_lconn {391 tcp_conn_t *conn;392 tcp_sockdata_t *socket;393 int index;394 link_t ready_list;395 } tcp_sock_lconn_t;396 397 353 #endif 398 354
Note:
See TracChangeset
for help on using the changeset viewer.