Changeset 048cd69 in mainline for uspace/lib/nettl


Ignore:
Timestamp:
2015-06-07T15:41:04Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
204ba47
Parents:
4d11204 (diff), c3f7d37 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge network transport layer API rewrite.

Location:
uspace/lib/nettl
Files:
3 added
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/nettl/Makefile

    r4d11204 r048cd69  
    11#
    2 # Copyright (c) 2005 Martin Decky
    3 # Copyright (c) 2007 Jakub Jermar
     2# Copyright (c) 2015 Jiri Svoboda
    43# All rights reserved.
    54#
     
    3029USPACE_PREFIX = ../..
    3130EXTRA_CFLAGS = -Iinclude
    32 LIBRARY = libnet
     31LIBRARY = libnettl
    3332
    3433SOURCES = \
    35         tl/socket_core.c
     34        src/amap.c \
     35        src/portrng.c
    3636
    3737include $(USPACE_PREFIX)/Makefile.common
  • uspace/lib/nettl/include/nettl/portrng.h

    r4d11204 r048cd69  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2015 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup nettest
     29/** @addtogroup libnettl
    3030 * @{
    3131 */
    32 
    33 /** @file
    34  * Networking test support functions.
     32/**
     33 * @file Port range allocator.
    3534 */
    3635
    37 #ifndef NET_TEST_
    38 #define NET_TEST_
     36#ifndef LIBNETTL_PORTRNG_H_
     37#define LIBNETTL_PORTRNG_H_
    3938
    40 #include <net/socket.h>
     39#include <stdbool.h>
     40#include <stdint.h>
    4141
    42 extern void print_mark(unsigned int);
    43 extern int sockets_create(int, int *, unsigned int, uint16_t, sock_type_t);
    44 extern int sockets_close(int, int *, unsigned int);
    45 extern int sockets_connect(int, int *, unsigned int, struct sockaddr *,
    46     socklen_t);
    47 extern int sockets_sendto(int, int *, unsigned int, struct sockaddr *,
    48     socklen_t, char *, size_t, unsigned int, sock_type_t);
    49 extern int sockets_recvfrom(int, int *, unsigned int, struct sockaddr *,
    50     socklen_t *, char *, size_t, unsigned int);
    51 extern int sockets_sendto_recvfrom(int, int *, unsigned int, struct sockaddr *,
    52     socklen_t *, char *, size_t, unsigned int, sock_type_t);
     42/** Allocated port */
     43typedef struct {
     44        /** Link to portrng_t.used */
     45        link_t lprng;
     46        /** Port number */
     47        uint16_t pn;
     48        /** User argument */
     49        void *arg;
     50} portrng_port_t;
     51
     52typedef struct {
     53        list_t used; /* of portrng_port_t */
     54} portrng_t;
     55
     56typedef enum {
     57        pf_allow_system = 0x1
     58} portrng_flags_t;
     59
     60extern int portrng_create(portrng_t **);
     61extern void portrng_destroy(portrng_t *);
     62extern int portrng_alloc(portrng_t *, uint16_t, void *,
     63    portrng_flags_t, uint16_t *);
     64extern int portrng_find_port(portrng_t *, uint16_t, void **);
     65extern void portrng_free_port(portrng_t *, uint16_t);
     66extern bool portrng_empty(portrng_t *);
    5367
    5468#endif
     
    5670/** @}
    5771 */
    58 
Note: See TracChangeset for help on using the changeset viewer.