Changeset fab2746 in mainline for uspace/srv/net/udp/udp_type.h


Ignore:
Timestamp:
2015-04-08T21:25:30Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
99ea91b2
Parents:
ba0eac5
Message:

New transport layer API. Only UDP implemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/udp/udp_type.h

    rba0eac5 rfab2746  
    3636#define UDP_TYPE_H
    3737
     38#include <async.h>
    3839#include <fibril.h>
    3940#include <fibril_synch.h>
    4041#include <ipc/loc.h>
    41 #include <socket_core.h>
    4242#include <sys/types.h>
    4343#include <inet/addr.h>
     
    9999
    100100typedef struct {
    101         async_sess_t *sess;
    102         socket_cores_t sockets;
    103 } udp_client_t;
     101        void (*recv_msg)(void *, udp_sockpair_t *, udp_msg_t *);
     102} udp_assoc_cb_t;
    104103
    105104/** UDP association
     
    131130        /** Receive queue CV. Broadcast when new datagram is inserted */
    132131        fibril_condvar_t rcv_queue_cv;
     132
     133        udp_assoc_cb_t *cb;
     134        void *cb_arg;
    133135} udp_assoc_t;
    134136
    135137typedef struct {
    136138} udp_assoc_status_t;
    137 
    138 typedef struct udp_sockdata {
    139         /** Lock */
    140         fibril_mutex_t lock;
    141         /** Socket core */
    142         socket_core_t *sock_core;
    143         /** Client */
    144         udp_client_t *client;
    145         /** Connection */
    146         udp_assoc_t *assoc;
    147         /** User-configured IP link */
    148         service_id_t iplink;
    149         /** Receiving fibril */
    150         fid_t recv_fibril;
    151         uint8_t recv_buffer[UDP_FRAGMENT_SIZE];
    152         size_t recv_buffer_used;
    153         udp_sock_t recv_fsock;
    154         fibril_mutex_t recv_buffer_lock;
    155         fibril_condvar_t recv_buffer_cv;
    156         udp_error_t recv_error;
    157 } udp_sockdata_t;
    158139
    159140typedef struct {
     
    166147} udp_rcv_queue_entry_t;
    167148
     149typedef struct udp_cassoc {
     150        /** Association */
     151        udp_assoc_t *assoc;
     152        /** Association ID for the client */
     153        sysarg_t id;
     154        /** Client */
     155        struct udp_client *client;
     156        link_t lclient;
     157} udp_cassoc_t;
     158
     159typedef struct {
     160        /** Link to receive queue */
     161        link_t link;
     162        /** Socket pair */
     163        udp_sockpair_t sp;
     164        /** Message */
     165        udp_msg_t *msg;
     166        /** Client association */
     167        udp_cassoc_t *cassoc;
     168} udp_crcv_queue_entry_t;
     169
     170typedef struct udp_client {
     171        /** Client callback session */
     172        async_sess_t *sess;
     173        /** Client assocations */
     174        list_t cassoc; /* of udp_cassoc_t */
     175        /** Client receive queue */
     176        list_t crcv_queue;
     177} udp_client_t;
     178
    168179#endif
    169180
Note: See TracChangeset for help on using the changeset viewer.