Changeset 849ed54 in mainline for uspace/app/nettest1


Ignore:
Timestamp:
2010-03-30T18:39:04Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7553689
Parents:
7d6fe4db
Message:

Networking work:
Split the networking stack into end-user library (libsocket) and two helper libraries (libnet and libnetif).
Don't use over-the-hand compiling and linking, but rather separation of conserns.
There might be still some issues and the non-modular networking architecture is currently broken, but this will be fixed soon.

Location:
uspace/app/nettest1
Files:
4 added
4 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/nettest1/Makefile

    r7d6fe4db r849ed54  
    2828#
    2929
    30 NET_BASE = ../..
    31 USPACE_PREFIX = ../../../..
    32 LIBS = $(NET_BASE)/socket/libsocket.a
     30USPACE_PREFIX = ../..
     31LIBS = $(LIBSOCKET_PREFIX)/libsocket.a
     32EXTRA_CFLAGS = -I$(LIBSOCKET_PREFIX)/include
    3333BINARY = nettest1
    3434
    3535SOURCES = \
    3636        nettest1.c \
    37         $(NET_BASE)/app/nettest.c \
    38         $(NET_BASE)/app/parse.c \
    39         $(NET_BASE)/app/print_error.c
     37        nettest.c \
     38        parse.c \
     39        print_error.c
    4040
    4141include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/nettest1/nettest.c

    r7d6fe4db r849ed54  
    3737#include <stdio.h>
    3838
    39 #include "../include/socket.h"
    40 
    41 #include "../err.h"
     39#include <socket.h>
     40#include <net_err.h>
    4241
    4342#include "nettest.h"
  • uspace/app/nettest1/nettest.h

    r7d6fe4db r849ed54  
    3838#define __NET_TEST__
    3939
    40 #include "../include/socket.h"
     40#include <socket.h>
    4141
    4242/** Prints a mark.
     
    4444 *  @param[in] index The index of the mark to be printed.
    4545 */
    46 void print_mark(int index);
     46extern void print_mark(int index);
    4747
    4848/** Creates new sockets.
     
    5555 *  @returns Other error codes as defined for the socket() function.
    5656 */
    57 int sockets_create(int verbose, int * socket_ids, int sockets, int family, sock_type_t type);
     57extern int sockets_create(int verbose, int * socket_ids, int sockets, int family, sock_type_t type);
    5858
    5959/** Closes sockets.
     
    6464 *  @returns Other error codes as defined for the closesocket() function.
    6565 */
    66 int sockets_close(int verbose, int * socket_ids, int sockets);
     66extern int sockets_close(int verbose, int * socket_ids, int sockets);
    6767
    6868/** Connects sockets.
     
    7575 *  @returns Other error codes as defined for the connect() function.
    7676 */
    77 int sockets_connect(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen);
     77extern int sockets_connect(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen);
    7878
    7979/** Sends data via sockets.
     
    8989 *  @returns Other error codes as defined for the sendto() function.
    9090 */
    91 int sockets_sendto(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen, char * data, int size, int messages);
     91extern int sockets_sendto(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen, char * data, int size, int messages);
    9292
    9393/** Receives data via sockets.
     
    103103 *  @returns Other error codes as defined for the recvfrom() function.
    104104 */
    105 int sockets_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
     105extern int sockets_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
    106106
    107107/** Sends and receives data via sockets.
     
    119119 *  @returns Other error codes as defined for the recvfrom() function.
    120120 */
    121 int sockets_sendto_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
     121extern int sockets_sendto_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
    122122
    123123#endif
  • uspace/app/nettest1/nettest1.c

    r7d6fe4db r849ed54  
    4141#include <time.h>
    4242
    43 #include "../../include/in.h"
    44 #include "../../include/in6.h"
    45 #include "../../include/inet.h"
    46 #include "../../include/socket.h"
    47 
    48 #include "../../err.h"
    49 
    50 #include "../nettest.h"
    51 #include "../parse.h"
    52 #include "../print_error.h"
     43#include <in.h>
     44#include <in6.h>
     45#include <inet.h>
     46#include <socket.h>
     47#include <net_err.h>
     48
     49#include "nettest.h"
     50#include "parse.h"
     51#include "print_error.h"
    5352
    5453/** Echo module name.
Note: See TracChangeset for help on using the changeset viewer.