Changeset ae481e0 in mainline for uspace/srv/net/tl/tcp/tcp_type.h


Ignore:
Timestamp:
2011-12-29T14:47:00Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2943db4
Parents:
827ec41
Message:

Implement listening backlog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/tcp/tcp_type.h

    r827ec41 rae481e0  
    152152} acpass_t;
    153153
    154 typedef struct tcp_conn {
     154typedef enum {
     155        tcp_open_nonblock = 1
     156} tcp_open_flags_t;
     157
     158typedef struct tcp_conn tcp_conn_t;
     159
     160/** Connection state change callback function */
     161typedef void (*tcp_cstate_cb_t)(tcp_conn_t *, void *);
     162
     163/** Connection */
     164struct tcp_conn {
    155165        char *name;
    156166        link_t link;
     167
     168        /** Connection state change callback function */
     169        tcp_cstate_cb_t cstate_cb;
     170        /** Argument to @c cstate_cb */
     171        void *cstate_cb_arg;
    157172
    158173        /** Connection identification (local and foreign socket) */
     
    233248        /** Initial receive sequence number */
    234249        uint32_t irs;
    235 } tcp_conn_t;
    236 
    237 typedef struct {
    238         unsigned dummy;
     250};
     251
     252/** Data returned by Status user call */
     253typedef struct {
     254        /** Connection state */
     255        tcp_cstate_t cstate;
    239256} tcp_conn_status_t;
    240257
     
    314331} tcp_client_t;
    315332
    316 typedef struct {
     333typedef struct tcp_sockdata {
     334        /** Lock */
     335        fibril_mutex_t lock;
     336        /** Socket core */
     337        socket_core_t *sock_core;
    317338        /** Client */
    318339        tcp_client_t *client;
     
    321342        /** Local address */
    322343        netaddr_t laddr;
     344        /** Backlog size */
     345        int backlog;
     346        /** Array of listening connections, @c backlog elements */
     347        struct tcp_sock_lconn **lconn;
     348        /** List of connections (from lconn) that are ready to be accepted */
     349        list_t ready;
    323350} tcp_sockdata_t;
     351
     352typedef struct tcp_sock_lconn {
     353        tcp_conn_t *conn;
     354        tcp_sockdata_t *socket;
     355        int index;
     356        link_t ready_list;
     357} tcp_sock_lconn_t;
     358
    324359
    325360#endif
Note: See TracChangeset for help on using the changeset viewer.