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


Ignore:
Timestamp:
2015-05-22T07:21:37Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
58e9dec
Parents:
bf7587b0
Message:

TCP and UDP servers can make use of inet/endpoint.h types internally.

File:
1 edited

Legend:

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

    rbf7587b0 r2f19103  
    11/*
    2  * Copyright (c) 2012 Jiri Svoboda
     2 * Copyright (c) 2015 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3939#include <fibril.h>
    4040#include <fibril_synch.h>
     41#include <inet/endpoint.h>
    4142#include <ipc/loc.h>
    4243#include <sys/types.h>
     
    4950        /* Insufficient resources */
    5051        UDP_ENORES,
    51         /* Foreign socket unspecified */
     52        /* Remote endpoint unspecified */
    5253        UDP_EUNSPEC,
    5354        /* No route to destination */
     
    6465        UDP_PORT_ANY = 0
    6566};
    66 
    67 typedef struct {
    68         inet_addr_t addr;
    69         uint16_t port;
    70 } udp_sock_t;
    71 
    72 typedef struct {
    73         service_id_t iplink;
    74         udp_sock_t local;
    75         udp_sock_t foreign;
    76 } udp_sockpair_t;
    7767
    7868/** Unencoded UDP message (datagram) */
     
    9989
    10090typedef struct {
    101         void (*recv_msg)(void *, udp_sockpair_t *, udp_msg_t *);
     91        void (*recv_msg)(void *, inet_ep2_t *, udp_msg_t *);
    10292} udp_assoc_cb_t;
    10393
     
    10696 * This is a rough equivalent of a TCP connection endpoint. It allows
    10797 * sending and receiving UDP datagrams and it is uniquely identified
    108  * by a socket pair.
     98 * by an endpoint pair.
    10999 */
    110100typedef struct {
     
    112102        link_t link;
    113103
    114         /** Association identification (local and foreign socket) */
    115         udp_sockpair_t ident;
     104        /** Association identification (endpoint pair) */
     105        inet_ep2_t ident;
    116106
    117107        /** True if association was reset by user */
     
    141131        /** Link to receive queue */
    142132        link_t link;
    143         /** Socket pair */
    144         udp_sockpair_t sp;
     133        /** Endpoint pair */
     134        inet_ep2_t epp;
    145135        /** Message */
    146136        udp_msg_t *msg;
     
    160150        /** Link to receive queue */
    161151        link_t link;
    162         /** Socket pair */
    163         udp_sockpair_t sp;
     152        /** Endpoint pair */
     153        inet_ep2_t epp;
    164154        /** Message */
    165155        udp_msg_t *msg;
Note: See TracChangeset for help on using the changeset viewer.