Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 04cd242 in mainline


Ignore:
Timestamp:
2011-11-27T18:20:58Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
a4ee3ab2
Parents:
762b48a
Message:

Implement socket provider API in tcp module (active side).

Location:
uspace
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/errno.h

    r762b48a r04cd242  
    9696#define ENOTCONN  (-10057)
    9797
     98#define ECONNREFUSED  (-10058)
     99
    98100/** The requested operation was not performed. Try again later. */
    99101#define EAGAIN  (-11002)
  • uspace/srv/net/tl/tcp/Makefile

    r762b48a r04cd242  
    4040        segment.c \
    4141        seq_no.c \
     42        sock.c \
    4243        tcp.c \
    4344        test.c \
  • uspace/srv/net/tl/tcp/tcp.c

    r762b48a r04cd242  
    5555#include "pdu.h"
    5656#include "rqueue.h"
     57#include "sock.h"
    5758#include "std.h"
    5859#include "tcp.h"
     
    6162#define NAME       "tcp"
    6263
    63 static async_sess_t *net_sess;
     64async_sess_t *net_sess;
    6465static async_sess_t *icmp_sess;
    6566static async_sess_t *ip_sess;
    66 static packet_dimensions_t pkt_dims;
     67packet_dimensions_t pkt_dims;
    6768
    6869static void tcp_received_pdu(tcp_pdu_t *pdu);
     
    354355    size_t *answer_count)
    355356{
     357        async_sess_t *callback;
     358
    356359        log_msg(LVL_DEBUG, "tl_message()");
     360
     361        *answer_count = 0;
     362        callback = async_callback_receive_start(EXCHANGE_SERIALIZE, call);
     363        if (callback)
     364                return tcp_sock_connection(callback, callid, *call);
     365
    357366        return ENOTSUP;
    358367}
  • uspace/srv/net/tl/tcp/tcp.h

    r762b48a r04cd242  
    3636#define TCP_H
    3737
     38#include <async.h>
     39#include <packet_remote.h>
    3840#include "tcp_type.h"
    3941
     42extern async_sess_t *net_sess;
    4043extern void tcp_transmit_pdu(tcp_pdu_t *);
    4144
  • uspace/srv/net/tl/tcp/tcp_type.h

    r762b48a r04cd242  
    3737
    3838#include <adt/list.h>
     39#include <async.h>
    3940#include <bool.h>
    4041#include <fibril_synch.h>
     42#include <socket_core.h>
    4143#include <sys/types.h>
    4244
     
    288290} tcp_pdu_t;
    289291
     292typedef struct {
     293        async_sess_t *sess;
     294        socket_cores_t sockets;
     295} tcp_client_t;
     296
     297typedef struct {
     298        tcp_client_t *client;
     299        tcp_conn_t *conn;
     300} tcp_sockdata_t;
     301
    290302#endif
    291303
  • uspace/srv/net/tl/tcp/test.c

    r762b48a r04cd242  
    124124        }
    125125
    126         rc = thread_create(test_cli, NULL, "test_cli", &cli_tid);
    127         if (rc != EOK) {
    128                 printf("Failed to create client thread.\n");
    129                 return;
     126        if (0) {
     127                rc = thread_create(test_cli, NULL, "test_cli", &cli_tid);
     128                if (rc != EOK) {
     129                        printf("Failed to create client thread.\n");
     130                        return;
     131                }
    130132        }
    131133}
Note: See TracChangeset for help on using the changeset viewer.