Changeset 779541b in mainline for uspace/srv/net/tcp/tcp_type.h


Ignore:
Timestamp:
2015-05-09T13:43:50Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1d4b815
Parents:
99ea91b2
Message:

TCP transport layer API - somewhat working.

File:
1 edited

Legend:

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

    r99ea91b2 r779541b  
    9696        TCP_EINVPREC,
    9797        /* Security/compartment not allowed */
    98         TCP_EINVCOMP
     98        TCP_EINVCOMP,
     99        TCP_EAGAIN
    99100} tcp_error_t;
    100101
     
    154155typedef void (*tcp_cstate_cb_t)(tcp_conn_t *, void *);
    155156
     157/** Connection callbacks */
     158typedef struct {
     159        void (*cstate_change)(tcp_conn_t *, void *);
     160        void (*recv_data)(tcp_conn_t *, void *);
     161} tcp_cb_t;
     162
    156163/** Connection */
    157164struct tcp_conn {
     
    159166        link_t link;
    160167
    161         /** Connection state change callback function */
    162         tcp_cstate_cb_t cstate_cb;
     168        /** Connection callbacks function */
     169        tcp_cb_t *cb;
    163170        /** Argument to @c cstate_cb */
    164         void *cstate_cb_arg;
     171        void *cb_arg;
    165172
    166173        /** Connection identification (local and foreign socket) */
     
    318325} tcp_pdu_t;
    319326
    320 typedef struct {
     327/** TCP client connection */
     328typedef struct tcp_cconn {
     329        /** Connection */
     330        tcp_conn_t *conn;
     331        /** Connection ID for the client */
     332        sysarg_t id;
     333        /** Client */
     334        struct tcp_client *client;
     335        link_t lclient;
     336} tcp_cconn_t;
     337
     338/** TCP client listener */
     339typedef struct tcp_clst {
     340        /** Connection */
     341        tcp_conn_t *conn;
     342        /** Listener ID for the client */
     343        sysarg_t id;
     344        /** Client */
     345        struct tcp_client *client;
     346        /** Link to tcp_client_t.clst */
     347        link_t lclient;
     348} tcp_clst_t;
     349
     350/** TCP client */
     351typedef struct tcp_client {
     352        /** Client callbac session */
    321353        async_sess_t *sess;
    322 //      socket_cores_t sockets;
     354        /** Client's connections */
     355        list_t cconn; /* of tcp_cconn_t */
     356        /** Client's listeners */
     357        list_t clst;
    323358} tcp_client_t;
    324359
     
    358393} tcp_sock_lconn_t;
    359394
    360 
    361395#endif
    362396
Note: See TracChangeset for help on using the changeset viewer.