Changes in / [3aae4e8:9f10660f] in mainline


Ignore:
Files:
119 added
137 deleted
58 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    r3aae4e8 r9f10660f  
    345345
    346346% Simics SMP Hack
    347 ! [PROCESSOR=sun4v&CONFIG_SMP=y] CONFIG_SIMICS_SMP_HACK (n/y)
     347! [PROCESSOR=sun4v] CONFIG_SIMICS_SMP_HACK (y/n)
    348348
    349349% Support for userspace debuggers
     
    523523
    524524% Networking architecture
     525@ "none" No networking
    525526@ "modular" Modular
    526527@ "module" One module
    527528! CONFIG_NETWORKING (choice)
    528529
     530% DP8390 (NE2k) network interface
     531! [CONFIG_NETWORKING=modular|CONFIG_NETWORKING=module] CONFIG_NETIF_DP8390 (y/n)
     532
  • boot/Makefile.common

    r3aae4e8 r9f10660f  
    5858        $(USPACEDIR)/srv/fs/tmpfs/tmpfs \
    5959        $(USPACEDIR)/srv/fs/fat/fat \
    60         $(USPACEDIR)/srv/taskmon/taskmon \
    61         $(USPACEDIR)/srv/hw/netif/dp8390/dp8390 \
    62         $(USPACEDIR)/srv/net/net/net \
    63         $(USPACEDIR)/srv/net/netstart/netstart \
    64         $(USPACEDIR)/srv/net/netif/lo/lo \
    65         $(USPACEDIR)/srv/net/nil/eth/eth \
    66         $(USPACEDIR)/srv/net/nil/nildummy/nildummy
     60        $(USPACEDIR)/srv/taskmon/taskmon
    6761
    6862RD_APPS = \
     
    7771        $(USPACEDIR)/app/tester/tester \
    7872        $(USPACEDIR)/app/tetris/tetris \
    79         $(USPACEDIR)/app/trace/trace \
    80         $(USPACEDIR)/app/netecho/netecho \
    81         $(USPACEDIR)/app/ping/ping \
    82         $(USPACEDIR)/app/nettest1/nettest1 \
    83         $(USPACEDIR)/app/nettest2/nettest2
     73        $(USPACEDIR)/app/trace/trace
    8474
    8575COMPONENTS = \
     
    9888endif
    9989
    100 NET_CFG = \
    101         $(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/general \
    102         $(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/lo \
    103         $(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/ne2k
     90CFG =
    10491
    105 ifeq ($(CONFIG_NETWORKING),modular)
    106         RD_SRVS += \
    107                 $(USPACEDIR)/srv/net/il/ip/ip \
    108                 $(USPACEDIR)/srv/net/il/arp/arp \
    109                 $(USPACEDIR)/srv/net/tl/udp/udp \
    110                 $(USPACEDIR)/srv/net/tl/tcp/tcp \
    111                 $(USPACEDIR)/srv/net/tl/icmp/icmp
     92NET_SRVS = \
     93        $(USPACEDIR)/srv/net/net/net \
     94        $(USPACEDIR)/srv/net/netif/lo/lo \
     95        $(USPACEDIR)/srv/net/nil/eth/eth \
     96        $(USPACEDIR)/srv/net/nil/nildummy/nildummy \
     97        $(USPACEDIR)/srv/net/app/echo/echo
     98
     99NET_APPS = \
     100        $(USPACEDIR)/srv/net/net/start/netstart \
     101        $(USPACEDIR)/srv/net/app/ping/ping \
     102        $(USPACEDIR)/srv/net/app/nettest1/nettest1 \
     103        $(USPACEDIR)/srv/net/app/nettest2/nettest2
     104
     105ifneq ($(CONFIG_NETWORKING),none)
     106        NET_CFG = \
     107                $(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/general \
     108                $(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/lo
     109       
     110        ifeq ($(CONFIG_NETIF_DP8390),y)
     111                NET_SRVS += $(USPACEDIR)/srv/net/netif/dp8390/dp8390
     112                NET_CFG += $(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/ne2k
     113        endif
     114       
     115        ifeq ($(CONFIG_NETWORKING),module)
     116                RD_APPS += $(NET_APPS)
     117                RD_SRVS += $(NET_SRVS)
     118                CFG += $(NET_CFG)
     119        endif
     120       
     121        ifeq ($(CONFIG_NETWORKING),modular)
     122                RD_APPS += $(NET_APPS)
     123                RD_SRVS += $(NET_SRVS)
     124                RD_SRVS += \
     125                        $(USPACEDIR)/srv/net/il/ip/ip \
     126                        $(USPACEDIR)/srv/net/il/arp/arp \
     127                        $(USPACEDIR)/srv/net/tl/udp/udp \
     128                        $(USPACEDIR)/srv/net/tl/tcp/tcp \
     129                        $(USPACEDIR)/srv/net/tl/icmp/icmp
     130                CFG += $(NET_CFG)
     131        endif
    112132endif
  • defaults/arm32/Makefile.config

    r3aae4e8 r9f10660f  
    3939
    4040# Default networking architecture
    41 CONFIG_NETWORKING = modular
     41CONFIG_NETWORKING = none
  • defaults/mips32/Makefile.config

    r3aae4e8 r9f10660f  
    4545
    4646# Default networking architecture
    47 CONFIG_NETWORKING = modular
     47CONFIG_NETWORKING = none
  • defaults/ppc32/Makefile.config

    r3aae4e8 r9f10660f  
    4545
    4646# Default networking architecture
    47 CONFIG_NETWORKING = modular
     47CONFIG_NETWORKING = none
  • defaults/sparc64/sun4v/Makefile.config

    r3aae4e8 r9f10660f  
    1212
    1313CONFIG_FB = n
     14
     15CONFIG_NETWORKING = none
  • defaults/special/Makefile.config

    r3aae4e8 r9f10660f  
    2828# Load disk drivers on startup
    2929CONFIG_START_BD = n
    30 
    31 # Default networking architecture
    32 CONFIG_NETWORKING = modular
  • defaults/special/abs32le/Makefile.config

    r3aae4e8 r9f10660f  
    44# Cross-compiler target
    55CROSS_TARGET = ia32
     6
     7# Networking architecture
     8CONFIG_NETWORKING = none
  • kernel/arch/amd64/src/amd64.c

    r3aae4e8 r9f10660f  
    228228            (uintptr_t) I8042_BASE);
    229229#endif
    230        
    231         /*
    232          * This nasty hack should also go away ASAP.
    233          */
     230
     231#ifdef CONFIG_NETIF_DP8390
    234232        trap_virtual_enable_irqs(1 << IRQ_DP8390);
    235233        sysinfo_set_item_val("netif.dp8390.inr", NULL, IRQ_DP8390);
     234#endif
    236235}
    237236
  • kernel/arch/ia32/src/ia32.c

    r3aae4e8 r9f10660f  
    186186            (uintptr_t) I8042_BASE);
    187187#endif
    188        
    189         /*
    190          * This nasty hack should also go away ASAP.
    191          */
     188
     189#ifdef CONFIG_NETIF_DP8390
    192190        trap_virtual_enable_irqs(1 << IRQ_DP8390);
    193191        sysinfo_set_item_val("netif.dp8390.inr", NULL, IRQ_DP8390);
     192#endif
    194193}
    195194
  • kernel/arch/ia64/src/ia64.c

    r3aae4e8 r9f10660f  
    213213#endif
    214214
     215#ifdef CONFIG_NETIF_DP8390
    215216        sysinfo_set_item_val("netif.dp8390.inr", NULL, IRQ_DP8390);
     217#endif
    216218
    217219        sysinfo_set_item_val("ia64_iospace", NULL, true);
  • kernel/arch/sparc64/src/smp/sun4v/smp.c

    r3aae4e8 r9f10660f  
    5454#include <arch/smp/sun4v/smp.h>
    5555#include <str.h>
    56 #include <errno.h>
    5756
    5857/** hypervisor code of the "running" state of the CPU */
  • uspace/Makefile

    r3aae4e8 r9f10660f  
    6565        srv/hid/fb \
    6666        srv/hid/kbd \
    67         srv/hw/char/i8042 \
    68         srv/hw/netif/dp8390
     67        srv/hw/char/i8042
    6968
    7069## Platform-specific hardware support
     
    9695#
    9796
     97ifeq ($(CONFIG_NETIF_DP8390),y)
     98        DIRS += srv/net/netif/dp8390
     99endif
     100
    98101NETWORKING_COMMON = \
    99102        srv/net/netif/lo \
     
    101104        srv/net/nil/nildummy \
    102105        srv/net/net \
    103         srv/net/netstart \
    104         app/netecho \
    105         app/nettest1 \
    106         app/nettest2 \
    107         app/ping
     106        srv/net/net/start \
     107        srv/net/socket \
     108        srv/net/app/echo \
     109        srv/net/app/ping \
     110        srv/net/app/nettest1 \
     111        srv/net/app/nettest2
    108112
    109113NETWORKING_MODULAR = \
     
    124128        lib/softint \
    125129        lib/softfloat \
    126         lib/socket \
    127         lib/net \
    128         lib/netif
    129130
    130131ifeq ($(UARCH),amd64)
     
    148149endif
    149150
     151ifeq ($(CONFIG_NETWORKING),none)
     152        BUILDS := $(addsuffix .build,$(DIRS))
     153endif
     154
    150155CLEANS := $(addsuffix .clean,$(DIRS)) $(addsuffix .clean,$(NETWORKING_COMMON)) $(addsuffix .clean,$(NETWORKING_MODULAR)) $(addsuffix .clean,$(LIBS)) $(addsuffix .clean,$(LIBC))
    151156
  • uspace/Makefile.common

    r3aae4e8 r9f10660f  
    7777
    7878LIB_PREFIX = $(USPACE_PREFIX)/lib
     79LIBC_PREFIX = $(USPACE_PREFIX)/lib/c
     80LIBBLOCK_PREFIX = $(USPACE_PREFIX)/lib/block
     81LIBFS_PREFIX = $(USPACE_PREFIX)/lib/fs
     82LIBPCI_PREFIX = $(USPACE_PREFIX)/lib/pci
     83SOFTFLOAT_PREFIX = $(USPACE_PREFIX)/lib/softfloat
     84SOFTINT_PREFIX = $(USPACE_PREFIX)/lib/softint
    7985
    80 LIBC_PREFIX = $(LIB_PREFIX)/c
    81 LIBSOFTFLOAT_PREFIX = $(LIB_PREFIX)/softfloat
    82 LIBSOFTINT_PREFIX = $(LIB_PREFIX)/softint
    83 
    84 LIBBLOCK_PREFIX = $(LIB_PREFIX)/block
    85 LIBFS_PREFIX = $(LIB_PREFIX)/fs
    86 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui
    87 
    88 LIBPCI_PREFIX = $(LIB_PREFIX)/pci
    89 
    90 LIBSOCKET_PREFIX = $(LIB_PREFIX)/socket
    91 LIBNET_PREFIX = $(LIB_PREFIX)/net
    92 LIBNETIF_PREFIX = $(LIB_PREFIX)/netif
    93 
    94 BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a
     86BASE_LIBS = $(LIBC_PREFIX)/libc.a $(SOFTINT_PREFIX)/libsoftint.a
    9587
    9688LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld
  • uspace/app/bdsh/Makefile

    r3aae4e8 r9f10660f  
    2929
    3030USPACE_PREFIX = ../..
    31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBCLUI_PREFIX)/libclui.a
    32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBCLUI_PREFIX) -I. -Icmds/ \
    33         -Icmds/builtins -Icmds/modules
     31LIBS = $(LIB_PREFIX)/block/libblock.a $(LIB_PREFIX)/clui/libclui.a
     32EXTRA_CFLAGS = -I$(LIB_PREFIX)/block -I$(LIB_PREFIX)/clui -I. -Icmds/ \
     33    -Icmds/builtins -Icmds/modules
    3434BINARY = bdsh
    3535
  • uspace/app/bdsh/input.c

    r3aae4e8 r9f10660f  
    5050#include "errors.h"
    5151#include "exec.h"
    52 
    53 extern volatile unsigned int cli_quit;
    5452
    5553/** Text input field. */
     
    109107{
    110108        char *str;
    111         int rc;
    112109
    113110        fflush(stdout);
     
    117114        console_set_style(fphone(stdout), STYLE_NORMAL);
    118115
    119         rc = tinput_read(tinput, &str);
    120         if (rc == ENOENT) {
    121                 /* User requested exit */
    122                 cli_quit = 1;
    123                 putchar('\n');
    124                 return;
    125         }
    126 
    127         if (rc != EOK) {
    128                 /* Error in communication with console */
    129                 return;
    130         }
     116        str = tinput_read(tinput);
    131117
    132118        /* Check for empty input. */
  • uspace/app/bdsh/scli.c

    r3aae4e8 r9f10660f  
    100100                }
    101101        }
     102        goto finit;
    102103
    103         printf("Leaving %s.\n", progname);
    104 
     104finit:
    105105        cli_finit(&usr);
    106106        return ret;
  • uspace/app/sbi/Makefile

    r3aae4e8 r9f10660f  
    2828
    2929USPACE_PREFIX = ../..
    30 LIBS = $(LIBCLUI_PREFIX)/libclui.a
    31 EXTRA_CFLAGS = -D__HELENOS__ -I$(LIBCLUI_PREFIX)
     30LIBS = $(LIB_PREFIX)/clui/libclui.a
     31EXTRA_CFLAGS = -D__HELENOS__ -I$(LIB_PREFIX)/clui
    3232
    3333BINARY = sbi
  • uspace/app/sbi/src/os/helenos.c

    r3aae4e8 r9f10660f  
    105105{
    106106        char *line;
    107         int rc;
    108107
    109108        if (tinput == NULL) {
     
    113112        }
    114113
    115         rc = tinput_read(tinput, &line);
    116         if (rc == ENOENT) {
    117                 /* User-requested abort */
    118                 *ptr = os_str_dup("");
    119                 return EOK;
    120         }
    121 
    122         if (rc != EOK) {
    123                 /* Error in communication with console */
     114        line = tinput_read(tinput);
     115        if (line == NULL)
    124116                return EIO;
    125         }
    126117
    127118        /* XXX Input module needs trailing newline to keep going. */
  • uspace/lib/clui/tinput.c

    r3aae4e8 r9f10660f  
    513513}
    514514
    515 /** Read in one line of input.
    516  *
    517  * @param ti    Text input.
    518  * @param dstr  Place to save pointer to new string.
    519  * @return      EOK on success, ENOENT if user requested abort, EIO
    520  *              if communication with console failed.
    521  */
    522 int tinput_read(tinput_t *ti, char **dstr)
     515/** Read in one line of input. */
     516char *tinput_read(tinput_t *ti)
    523517{
    524518        console_event_t ev;
     
    528522
    529523        if (console_get_size(fphone(stdin), &ti->con_cols, &ti->con_rows) != EOK)
    530                 return EIO;
     524                return NULL;
    531525        if (console_get_pos(fphone(stdin), &ti->col0, &ti->row0) != EOK)
    532                 return EIO;
     526                return NULL;
    533527
    534528        ti->pos = ti->sel_start = 0;
     
    536530        ti->buffer[0] = '\0';
    537531        ti->done = false;
    538         ti->exit_clui = false;
    539532
    540533        while (!ti->done) {
    541534                fflush(stdout);
    542535                if (!console_get_event(fphone(stdin), &ev))
    543                         return EIO;
     536                        return NULL;
    544537
    545538                if (ev.type != KEY_PRESS)
     
    572565        }
    573566
    574         if (ti->exit_clui)
    575                 return ENOENT;
    576 
    577567        ti->pos = ti->nc;
    578568        tinput_position_caret(ti);
     
    585575        ti->hpos = 0;
    586576
    587         *dstr = str;
    588         return EOK;
     577        return str;
    589578}
    590579
     
    617606        case KC_A:
    618607                tinput_sel_all(ti);
    619                 break;
    620         case KC_Q:
    621                 /* Signal libary client to quit interactive loop. */
    622                 ti->done = true;
    623                 ti->exit_clui = true;
    624608                break;
    625609        default:
  • uspace/lib/clui/tinput.h

    r3aae4e8 r9f10660f  
    6464        /** Current position in history */
    6565        int hpos;
    66         /** @c true if finished with this line (return to caller) */
     66        /** Exit flag */
    6767        bool done;
    68         /** @c true if user requested to abort interactive loop */
    69         bool exit_clui;
    7068} tinput_t;
    7169
    7270extern tinput_t *tinput_new(void);
    7371extern void tinput_destroy(tinput_t *ti);
    74 extern int tinput_read(tinput_t *ti, char **str);
     72extern char *tinput_read(tinput_t *ti);
    7573
    7674#endif
  • uspace/srv/net/il/arp/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ../..
    3031USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3332BINARY = arp
    3433
    3534SOURCES = \
    3635        arp.c \
    37         arp_module.c
     36        arp_module.c \
     37        $(NET_BASE)/module.c \
     38        $(NET_BASE)/modules.c \
     39        $(NET_BASE)/net/net_remote.c \
     40        $(NET_BASE)/nil/nil_remote.c \
     41        $(NET_BASE)/structures/char_map.c \
     42        $(NET_BASE)/structures/measured_strings.c \
     43        $(NET_BASE)/structures/packet/packet.c \
     44        $(NET_BASE)/structures/packet/packet_client.c \
     45        $(NET_BASE)/structures/packet/packet_remote.c
    3846
    3947include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/il/arp/arp.c

    r3aae4e8 r9f10660f  
    4343#include <str.h>
    4444#include <task.h>
     45
    4546#include <ipc/ipc.h>
    4647#include <ipc/services.h>
    4748
    48 #include <net_err.h>
    49 #include <net_messages.h>
    50 #include <net_modules.h>
    51 #include <net_byteorder.h>
    52 #include <net_device.h>
    53 #include <arp_interface.h>
    54 #include <nil_interface.h>
    55 #include <protocol_map.h>
    56 #include <adt/measured_strings.h>
    57 #include <packet/packet.h>
    58 #include <packet/packet_client.h>
    59 #include <il_messages.h>
    60 #include <arp_messages.h>
     49#include "../../err.h"
     50#include "../../messages.h"
     51#include "../../modules.h"
     52
     53#include "../../include/byteorder.h"
     54#include "../../include/device.h"
     55#include "../../include/arp_interface.h"
     56#include "../../include/nil_interface.h"
     57#include "../../include/protocol_map.h"
     58
     59#include "../../structures/measured_strings.h"
     60#include "../../structures/packet/packet.h"
     61#include "../../structures/packet/packet_client.h"
     62
     63#include "../il_messages.h"
    6164
    6265#include "arp.h"
     
    6467#include "arp_oc.h"
    6568#include "arp_module.h"
    66 
    67 
    68 /** ARP module name.
    69  */
    70 #define NAME    "ARP protocol"
     69#include "arp_messages.h"
    7170
    7271/** ARP global data.
     
    619618}
    620619
    621 #ifdef CONFIG_NETWORKING_modular
    622 
    623 #include <il_standalone.h>
    624 
    625 /** Default thread for new connections.
    626  *
    627  *  @param[in] iid The initial message identifier.
    628  *  @param[in] icall The initial message call structure.
    629  *
    630  */
    631 static void il_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    632 {
    633         /*
    634          * Accept the connection
    635          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    636          */
    637         ipc_answer_0(iid, EOK);
    638        
    639         while(true) {
    640                 ipc_call_t answer;
    641                 int answer_count;
    642                
    643                 /* Clear the answer structure */
    644                 refresh_answer(&answer, &answer_count);
    645                
    646                 /* Fetch the next message */
    647                 ipc_call_t call;
    648                 ipc_callid_t callid = async_get_call(&call);
    649                
    650                 /* Process the message */
    651                 int res = il_module_message(callid, &call, &answer, &answer_count);
    652                
    653                 /* End if said to either by the message or the processing result */
    654                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    655                         return;
    656                
    657                 /* Answer the message */
    658                 answer_call(callid, res, &answer, answer_count);
    659         }
    660 }
    661 
    662 /** Starts the module.
    663  *
    664  *  @param argc The count of the command line arguments. Ignored parameter.
    665  *  @param argv The command line parameters. Ignored parameter.
    666  *
    667  *  @returns EOK on success.
    668  *  @returns Other error codes as defined for each specific module start function.
    669  *
    670  */
    671 int main(int argc, char *argv[])
    672 {
    673         ERROR_DECLARE;
    674        
    675         /* Print the module label */
    676         printf("Task %d - %s\n", task_get_id(), NAME);
    677        
    678         /* Start the module */
    679         if (ERROR_OCCURRED(il_module_start(il_client_connection))) {
    680                 printf(" - ERROR %i\n", ERROR_CODE);
    681                 return ERROR_CODE;
    682         }
    683        
    684         return EOK;
    685 }
    686 
    687 #endif /* CONFIG_NETWORKING_modular */
    688 
    689620/** @}
    690621 */
  • uspace/srv/net/il/arp/arp.h

    r3aae4e8 r9f10660f  
    4343#include <ipc/services.h>
    4444
    45 #include <net_device.h>
    46 #include <net_hardware.h>
    47 #include <adt/generic_char_map.h>
    48 #include <adt/int_map.h>
    49 #include <adt/measured_strings.h>
     45#include "../../include/device.h"
     46#include "../../include/hardware.h"
     47
     48#include "../../structures/generic_char_map.h"
     49#include "../../structures/int_map.h"
     50#include "../../structures/measured_strings.h"
    5051
    5152
  • uspace/srv/net/il/arp/arp_module.c

    r3aae4e8 r9f10660f  
    4444#include <ipc/services.h>
    4545
    46 #include <net_err.h>
    47 #include <net_modules.h>
    48 #include <net_interface.h>
    49 #include <packet/packet.h>
    50 #include <il_standalone.h>
     46#include "../../err.h"
     47#include "../../modules.h"
     48
     49#include "../../include/net_interface.h"
     50
     51#include "../../structures/packet/packet.h"
    5152
    5253#include "arp.h"
    5354#include "arp_module.h"
     55
     56/** ARP module name.
     57 */
     58#define NAME    "ARP protocol"
    5459
    5560/** ARP module global data.
     
    6570 *  @returns Other error codes as defined for the arp_message() function.
    6671 */
    67 int il_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    68         return arp_message(callid, call, answer, answer_count);
    69 }
     72int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     73
     74/** Prints the module name.
     75 *  @see NAME
     76 */
     77void module_print_name(void);
    7078
    7179/** Starts the ARP module.
     
    7684 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    7785 */
    78 int il_module_start(async_client_conn_t client_connection){
     86int module_start(async_client_conn_t client_connection);
     87
     88int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     89        return arp_message(callid, call, answer, answer_count);
     90}
     91
     92void module_print_name(void){
     93        printf("%s", NAME);
     94}
     95
     96int module_start(async_client_conn_t client_connection){
    7997        ERROR_DECLARE;
    8098
  • uspace/srv/net/il/ip/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ../..
    3031USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3332BINARY = ip
    3433
    3534SOURCES = \
    3635        ip.c \
    37         ip_module.c
     36        ip_client.c \
     37        ip_module.c \
     38        $(NET_BASE)/checksum.c \
     39        $(NET_BASE)/inet.c \
     40        $(NET_BASE)/module.c \
     41        $(NET_BASE)/modules.c \
     42        $(NET_BASE)/il/arp/arp_remote.c \
     43        $(NET_BASE)/nil/nil_remote.c \
     44        $(NET_BASE)/net/net_remote.c \
     45        $(NET_BASE)/tl/icmp/icmp_client.c \
     46        $(NET_BASE)/tl/icmp/icmp_common.c \
     47        $(NET_BASE)/tl/icmp/icmp_remote.c \
     48        $(NET_BASE)/structures/char_map.c \
     49        $(NET_BASE)/structures/measured_strings.c \
     50        $(NET_BASE)/structures/module_map.c \
     51        $(NET_BASE)/structures/packet/packet.c \
     52        $(NET_BASE)/structures/packet/packet_client.c \
     53        $(NET_BASE)/structures/packet/packet_remote.c
    3854
    3955include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/il/ip/ip.c

    r3aae4e8 r9f10660f  
    4141#include <stdio.h>
    4242#include <str.h>
     43
    4344#include <ipc/ipc.h>
    4445#include <ipc/services.h>
     46
    4547#include <sys/types.h>
    4648
    47 #include <net_err.h>
    48 #include <net_messages.h>
    49 #include <net_modules.h>
    50 #include <arp_interface.h>
    51 #include <net_byteorder.h>
    52 #include <net_checksum.h>
    53 #include <net_device.h>
    54 #include <icmp_client.h>
    55 #include <icmp_codes.h>
    56 #include <icmp_interface.h>
    57 #include <il_interface.h>
    58 #include <in.h>
    59 #include <in6.h>
    60 #include <inet.h>
    61 #include <ip_client.h>
    62 #include <ip_interface.h>
    63 #include <net_interface.h>
    64 #include <nil_interface.h>
    65 #include <tl_interface.h>
    66 #include <socket_codes.h>
    67 #include <socket_errno.h>
    68 #include <adt/measured_strings.h>
    69 #include <adt/module_map.h>
    70 #include <packet/packet_client.h>
    71 #include <nil_messages.h>
    72 #include <il_messages.h>
     49#include "../../err.h"
     50#include "../../messages.h"
     51#include "../../modules.h"
     52
     53#include "../../include/arp_interface.h"
     54#include "../../include/byteorder.h"
     55#include "../../include/checksum.h"
     56#include "../../include/device.h"
     57#include "../../include/icmp_client.h"
     58#include "../../include/icmp_codes.h"
     59#include "../../include/icmp_interface.h"
     60#include "../../include/il_interface.h"
     61#include "../../include/in.h"
     62#include "../../include/in6.h"
     63#include "../../include/inet.h"
     64#include "../../include/ip_client.h"
     65#include "../../include/ip_interface.h"
     66#include "../../include/net_interface.h"
     67#include "../../include/nil_interface.h"
     68#include "../../include/tl_interface.h"
     69#include "../../include/socket_codes.h"
     70#include "../../include/socket_errno.h"
     71#include "../../structures/measured_strings.h"
     72#include "../../structures/module_map.h"
     73#include "../../structures/packet/packet_client.h"
     74
     75#include "../../nil/nil_messages.h"
     76
     77#include "../il_messages.h"
    7378
    7479#include "ip.h"
     
    7681#include "ip_messages.h"
    7782#include "ip_module.h"
    78 
    79 /** IP module name.
    80  */
    81 #define NAME    "IP protocol"
    8283
    8384/** IP version 4.
     
    16231624}
    16241625
    1625 #ifdef CONFIG_NETWORKING_modular
    1626 
    1627 #include <il_standalone.h>
    1628 
    1629 /** Default thread for new connections.
    1630  *
    1631  *  @param[in] iid The initial message identifier.
    1632  *  @param[in] icall The initial message call structure.
    1633  *
    1634  */
    1635 static void il_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    1636 {
    1637         /*
    1638          * Accept the connection
    1639          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    1640          */
    1641         ipc_answer_0(iid, EOK);
    1642        
    1643         while(true) {
    1644                 ipc_call_t answer;
    1645                 int answer_count;
    1646                
    1647                 /* Clear the answer structure */
    1648                 refresh_answer(&answer, &answer_count);
    1649                
    1650                 /* Fetch the next message */
    1651                 ipc_call_t call;
    1652                 ipc_callid_t callid = async_get_call(&call);
    1653                
    1654                 /* Process the message */
    1655                 int res = il_module_message(callid, &call, &answer, &answer_count);
    1656                
    1657                 /* End if said to either by the message or the processing result */
    1658                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    1659                         return;
    1660                
    1661                 /* Answer the message */
    1662                 answer_call(callid, res, &answer, answer_count);
    1663         }
    1664 }
    1665 
    1666 /** Starts the module.
    1667  *
    1668  *  @param argc The count of the command line arguments. Ignored parameter.
    1669  *  @param argv The command line parameters. Ignored parameter.
    1670  *
    1671  *  @returns EOK on success.
    1672  *  @returns Other error codes as defined for each specific module start function.
    1673  *
    1674  */
    1675 int main(int argc, char *argv[])
    1676 {
    1677         ERROR_DECLARE;
    1678        
    1679         /* Print the module label */
    1680         printf("Task %d - %s\n", task_get_id(), NAME);
    1681        
    1682         /* Start the module */
    1683         if (ERROR_OCCURRED(il_module_start(il_client_connection))) {
    1684                 printf(" - ERROR %i\n", ERROR_CODE);
    1685                 return ERROR_CODE;
    1686         }
    1687        
    1688         return EOK;
    1689 }
    1690 
    1691 #endif /* CONFIG_NETWORKING_modular */
    1692 
    16931626/** @}
    16941627 */
  • uspace/srv/net/il/ip/ip.h

    r3aae4e8 r9f10660f  
    3939
    4040#include <fibril_synch.h>
     41
    4142#include <ipc/ipc.h>
    4243#include <ipc/services.h>
    4344
    44 #include <net_device.h>
    45 #include <inet.h>
    46 #include <ip_interface.h>
    47 #include <adt/int_map.h>
    48 #include <adt/generic_field.h>
    49 #include <adt/module_map.h>
     45#include "../../include/device.h"
     46#include "../../include/inet.h"
     47#include "../../include/ip_interface.h"
     48
     49#include "../../structures/int_map.h"
     50#include "../../structures/generic_field.h"
     51#include "../../structures/module_map.h"
    5052
    5153/** Type definition of the IP global data.
  • uspace/srv/net/il/ip/ip_module.c

    r3aae4e8 r9f10660f  
    4040#include <async.h>
    4141#include <stdio.h>
     42
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    46 #include <net_modules.h>
    47 #include <net_interface.h>
    48 #include <packet/packet.h>
    49 #include <il_standalone.h>
     46#include "../../err.h"
     47#include "../../modules.h"
     48
     49#include "../../include/net_interface.h"
     50
     51#include "../../structures/packet/packet.h"
    5052
    5153#include "ip.h"
    5254#include "ip_module.h"
     55
     56/** IP module name.
     57 */
     58#define NAME    "IP protocol"
    5359
    5460/** IP module global data.
     
    6470 *  @returns Other error codes as defined for the ip_message() function.
    6571 */
    66 int il_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    67         return ip_message(callid, call, answer, answer_count);
    68 }
     72int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     73
     74/** Prints the module name.
     75 *  @see NAME
     76 */
     77void module_print_name(void);
    6978
    7079/** Starts the IP module.
     
    7584 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    7685 */
    77 int il_module_start(async_client_conn_t client_connection){
     86int module_start(async_client_conn_t client_connection);
     87
     88int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     89        return ip_message(callid, call, answer, answer_count);
     90}
     91
     92void module_print_name(void){
     93        printf("%s", NAME);
     94}
     95
     96int module_start(async_client_conn_t client_connection){
    7897        ERROR_DECLARE;
    7998
  • uspace/srv/net/net/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ..
    3031USPACE_PREFIX = ../../..
    3132ROOT_PATH = $(USPACE_PREFIX)/..
    32 LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    33 EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3433
    3534COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
    3635CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
    3736
     37BINARY = net
     38
    3839-include $(COMMON_MAKEFILE)
    3940-include $(CONFIG_MAKEFILE)
    4041
    41 BINARY = net
    42 
    4342SOURCES = \
    4443        net.c \
    45         net_standalone.c
     44        $(NET_BASE)/module.c \
     45        $(NET_BASE)/modules.c \
     46        $(NET_BASE)/netif/netif_remote.c \
     47        $(NET_BASE)/structures/char_map.c \
     48        $(NET_BASE)/structures/measured_strings.c \
     49        $(NET_BASE)/structures/module_map.c \
     50        $(NET_BASE)/structures/packet/packet.c \
     51        $(NET_BASE)/structures/packet/packet_client.c \
     52        $(NET_BASE)/structures/packet/packet_server.c
     53
     54ifeq ($(CONFIG_NETWORKING),module)
     55        SOURCES += \
     56                net_bundle.c \
     57                $(NET_BASE)/checksum.c \
     58                $(NET_BASE)/inet.c \
     59                $(NET_BASE)/il/arp/arp.c \
     60                $(NET_BASE)/il/ip/ip.c \
     61                $(NET_BASE)/il/ip/ip_client.c \
     62                $(NET_BASE)/socket/socket_core.c \
     63                $(NET_BASE)/tl/icmp/icmp.c \
     64                $(NET_BASE)/tl/icmp/icmp_client.c \
     65                $(NET_BASE)/tl/tcp/tcp.c \
     66                $(NET_BASE)/tl/tl_common.c \
     67                $(NET_BASE)/tl/udp/udp.c \
     68                $(NET_BASE)/structures/dynamic_fifo.c
     69endif
     70
     71ifeq ($(CONFIG_NETWORKING),modular)
     72        SOURCES += \
     73                net_standalone.c \
     74                $(NET_BASE)/il/ip/ip_remote.c
     75endif
    4676
    4777include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/net/net.c

    r3aae4e8 r9f10660f  
    4646#include <ipc/services.h>
    4747
    48 #include <net_err.h>
    49 #include <net_messages.h>
    50 #include <net_modules.h>
    51 #include <adt/char_map.h>
    52 #include <adt/generic_char_map.h>
    53 #include <adt/measured_strings.h>
    54 #include <adt/module_map.h>
    55 #include <packet/packet.h>
    56 #include <il_messages.h>
    57 #include <net_device.h>
    58 #include <netif_interface.h>
    59 #include <nil_interface.h>
    60 #include <net_interface.h>
    61 #include <ip_interface.h>
    62 #include <net_net_messages.h>
     48#include "../err.h"
     49#include "../messages.h"
     50#include "../modules.h"
     51
     52#include "../structures/char_map.h"
     53#include "../structures/generic_char_map.h"
     54#include "../structures/measured_strings.h"
     55#include "../structures/module_map.h"
     56#include "../structures/packet/packet.h"
     57
     58#include "../il/il_messages.h"
     59#include "../include/device.h"
     60#include "../include/netif_interface.h"
     61#include "../include/nil_interface.h"
     62#include "../include/net_interface.h"
     63#include "../include/ip_interface.h"
    6364
    6465#include "net.h"
     66#include "net_messages.h"
    6567
    6668/** File read buffer size.
     
    8082 */
    8183device_id_t generate_new_device_id(void);
     84
     85/** Prints the module name.
     86 *  @see NAME
     87 */
     88void module_print_name(void);
     89
     90/** Starts the networking module.
     91 *  Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop.
     92 *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
     93 *  @returns EOK on successful module termination.
     94 *  @returns Other error codes as defined for the net_initialize() function.
     95 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
     96 */
     97int module_start(async_client_conn_t client_connection);
    8298
    8399/** Returns the configured values.
     
    169185}
    170186
    171 /** Starts the networking module.
    172  *  Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop.
    173  *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
    174  *  @returns EOK on successful module termination.
    175  *  @returns Other error codes as defined for the net_initialize() function.
    176  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    177  */
    178 static int net_module_start(async_client_conn_t client_connection){
     187void module_print_name(void){
     188        printf("%s", NAME);
     189}
     190
     191int module_start(async_client_conn_t client_connection){
    179192        ERROR_DECLARE;
    180193
     
    498511        ERROR_DECLARE;
    499512
     513#ifdef CONFIG_NETIF_DP8390
    500514        const char * conf_files[] = {"lo", "ne2k"};
     515#else
     516        const char * conf_files[] = {"lo"};
     517#endif
    501518
    502519        int count = sizeof(conf_files) / sizeof(char *);
     
    563580}
    564581
    565 /** Default thread for new connections.
    566  *
    567  *  @param[in] iid The initial message identifier.
    568  *  @param[in] icall The initial message call structure.
    569  *
    570  */
    571 static void net_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    572 {
    573         /*
    574          * Accept the connection
    575          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    576          */
    577         ipc_answer_0(iid, EOK);
    578        
    579         while(true) {
    580                 ipc_call_t answer;
    581                 int answer_count;
    582                
    583                 /* Clear the answer structure */
    584                 refresh_answer(&answer, &answer_count);
    585                
    586                 /* Fetch the next message */
    587                 ipc_call_t call;
    588                 ipc_callid_t callid = async_get_call(&call);
    589                
    590                 /* Process the message */
    591                 int res = net_module_message(callid, &call, &answer, &answer_count);
    592                
    593                 /* End if said to either by the message or the processing result */
    594                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    595                         return;
    596                
    597                 /* Answer the message */
    598                 answer_call(callid, res, &answer, answer_count);
    599         }
    600 }
    601 
    602 /** Starts the module.
    603  *
    604  *  @param argc The count of the command line arguments. Ignored parameter.
    605  *  @param argv The command line parameters. Ignored parameter.
    606  *
    607  *  @returns EOK on success.
    608  *  @returns Other error codes as defined for each specific module start function.
    609  *
    610  */
    611 int main(int argc, char *argv[])
    612 {
    613         ERROR_DECLARE;
    614        
    615         /* Print the module label */
    616         printf("Task %d - %s\n", task_get_id(), NAME);
    617        
    618         /* Start the module */
    619         if (ERROR_OCCURRED(net_module_start(net_client_connection))) {
    620                 printf(" - ERROR %i\n", ERROR_CODE);
    621                 return ERROR_CODE;
    622         }
    623        
    624         return EOK;
    625 }
    626 
    627582/** @}
    628583 */
  • uspace/srv/net/net/net.h

    r3aae4e8 r9f10660f  
    4040#include <ipc/ipc.h>
    4141
    42 #include <net_device.h>
    43 #include <adt/char_map.h>
    44 #include <adt/generic_char_map.h>
    45 #include <adt/measured_strings.h>
    46 #include <adt/module_map.h>
    47 #include <packet/packet.h>
     42#include "../include/device.h"
     43
     44#include "../structures/char_map.h"
     45#include "../structures/generic_char_map.h"
     46#include "../structures/measured_strings.h"
     47#include "../structures/module_map.h"
     48#include "../structures/packet/packet.h"
    4849
    4950/** @name Modules definitions
     
    221222 *  @returns Other error codes as defined for each bundled module message function.
    222223 */
    223 int net_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     224int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    224225
    225226/** Initializes the networking module for the chosen subsystem build type.
  • uspace/srv/net/net/net_bundle.c

    r3aae4e8 r9f10660f  
    7979}
    8080
    81 int net_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     81int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    8282        if((IPC_GET_METHOD(*call) == IPC_M_CONNECT_TO_ME)
    8383                || IS_NET_IL_MESSAGE(call)
  • uspace/srv/net/net/net_standalone.c

    r3aae4e8 r9f10660f  
    3939#include <ipc/ipc.h>
    4040
    41 #include <net_messages.h>
    42 #include <ip_interface.h>
    43 #include <adt/measured_strings.h>
    44 #include <adt/module_map.h>
    45 #include <packet/packet_server.h>
     41#include "../messages.h"
     42
     43#include "../include/ip_interface.h"
     44
     45#include "../structures/measured_strings.h"
     46#include "../structures/module_map.h"
     47#include "../structures/packet/packet_server.h"
    4648
    4749#include "net.h"
     
    7375}
    7476
    75 int net_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     77int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    7678        if(IS_NET_PACKET_MESSAGE(call)){
    7779                return packet_server_message(callid, call, answer, answer_count);
  • uspace/srv/net/netif/lo/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ../..
    3031USPACE_PREFIX = ../../../..
    3132ROOT_PATH = $(USPACE_PREFIX)/..
    32 LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    33 EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3433
    3534COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
    3635CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
    3736
     37BINARY = lo
     38
    3839-include $(COMMON_MAKEFILE)
    3940-include $(CONFIG_MAKEFILE)
    4041
    41 ifeq ($(CONFIG_NETWORKING),modular)
    42         BINARY = lo
     42SOURCES = \
     43        lo.c \
     44        $(NET_BASE)/module.c \
     45        $(NET_BASE)/modules.c \
     46        $(NET_BASE)/net/net_remote.c \
     47        $(NET_BASE)/netif/netif.c \
     48        $(NET_BASE)/structures/measured_strings.c \
     49        $(NET_BASE)/structures/packet/packet.c \
     50        $(NET_BASE)/structures/packet/packet_client.c \
     51        $(NET_BASE)/structures/packet/packet_remote.c
     52
     53ifeq ($(CONFIG_NETWORKING),module)
     54        SOURCES += \
     55                $(NET_BASE)/nil/nildummy/nildummy.c \
     56                $(NET_BASE)/netif/netif_nil_bundle.c
    4357endif
    4458
    45 ifeq ($(CONFIG_NETWORKING),module)
    46         LIBRARY = liblo
     59ifeq ($(CONFIG_NETWORKING),modular)
     60        SOURCES += \
     61                $(NET_BASE)/nil/nil_remote.c \
     62                $(NET_BASE)/netif/netif_standalone.c
    4763endif
    4864
    49 SOURCES = \
    50         lo.c
    51 
    5265include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/netif/lo/lo.c

    r3aae4e8 r9f10660f  
    4343#include <ipc/services.h>
    4444
    45 #include <net_err.h>
    46 #include <net_messages.h>
    47 #include <net_modules.h>
    48 #include <adt/measured_strings.h>
    49 #include <packet/packet_client.h>
    50 #include <net_device.h>
    51 #include <nil_interface.h>
    52 #include <nil_messages.h>
    53 #include <netif.h>
    54 #include <netif_module.h>
     45#include "../../err.h"
     46#include "../../messages.h"
     47#include "../../modules.h"
     48
     49#include "../../structures/measured_strings.h"
     50#include "../../structures/packet/packet_client.h"
     51
     52#include "../../include/device.h"
     53#include "../../include/nil_interface.h"
     54
     55#include "../../nil/nil_messages.h"
     56
     57#include "../netif.h"
     58#include "../netif_module.h"
    5559
    5660/** Default hardware address.
     
    8690 */
    8791int create(device_id_t device_id, device_ref * device);
     92
     93/** Prints the module name.
     94 *  @see NAME
     95 */
     96void module_print_name(void);
    8897
    8998int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     
    158167}
    159168
     169void module_print_name(void){
     170        printf("%s", NAME);
     171}
     172
    160173int netif_probe_message(device_id_t device_id, int irq, uintptr_t io){
    161174        ERROR_DECLARE;
     
    207220}
    208221
    209 #ifdef CONFIG_NETWORKING_modular
    210 
    211 #include <netif_standalone.h>
    212 
    213 /** Default thread for new connections.
    214  *
    215  *  @param[in] iid The initial message identifier.
    216  *  @param[in] icall The initial message call structure.
    217  *
    218  */
    219 static void netif_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    220 {
    221         /*
    222          * Accept the connection
    223          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    224          */
    225         ipc_answer_0(iid, EOK);
    226        
    227         while(true) {
    228                 ipc_call_t answer;
    229                 int answer_count;
    230                
    231                 /* Clear the answer structure */
    232                 refresh_answer(&answer, &answer_count);
    233                
    234                 /* Fetch the next message */
    235                 ipc_call_t call;
    236                 ipc_callid_t callid = async_get_call(&call);
    237                
    238                 /* Process the message */
    239                 int res = netif_module_message(callid, &call, &answer, &answer_count);
    240                
    241                 /* End if said to either by the message or the processing result */
    242                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    243                         return;
    244                
    245                 /* Answer the message */
    246                 answer_call(callid, res, &answer, answer_count);
    247         }
    248 }
    249 
    250 /** Starts the module.
    251  *
    252  *  @param argc The count of the command line arguments. Ignored parameter.
    253  *  @param argv The command line parameters. Ignored parameter.
    254  *
    255  *  @returns EOK on success.
    256  *  @returns Other error codes as defined for each specific module start function.
    257  *
    258  */
    259 int main(int argc, char *argv[])
    260 {
    261         ERROR_DECLARE;
    262        
    263         /* Print the module label */
    264         printf("Task %d - %s\n", task_get_id(), NAME);
    265        
    266         /* Start the module */
    267         if (ERROR_OCCURRED(netif_module_start(netif_client_connection))) {
    268                 printf(" - ERROR %i\n", ERROR_CODE);
    269                 return ERROR_CODE;
    270         }
    271        
    272         return EOK;
    273 }
    274 
    275 #endif /* CONFIG_NETWORKING_modular */
    276 
    277222/** @}
    278223 */
  • uspace/srv/net/nil/eth/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ../..
    3031USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3332BINARY = eth
    3433
    3534SOURCES = \
    3635        eth.c \
    37         eth_module.c
     36        eth_module.c \
     37        $(NET_BASE)/checksum.c \
     38        $(NET_BASE)/module.c \
     39        $(NET_BASE)/modules.c \
     40        $(NET_BASE)/net/net_remote.c \
     41        $(NET_BASE)/netif/netif_remote.c \
     42        $(NET_BASE)/structures/measured_strings.c \
     43        $(NET_BASE)/structures/packet/packet.c \
     44        $(NET_BASE)/structures/packet/packet_client.c \
     45        $(NET_BASE)/structures/packet/packet_remote.c
    3846
    3947include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/nil/eth/eth.c

    r3aae4e8 r9f10660f  
    4545#include <ipc/services.h>
    4646
    47 #include <net_err.h>
    48 #include <net_messages.h>
    49 #include <net_modules.h>
    50 #include <net_byteorder.h>
    51 #include <net_checksum.h>
    52 #include <ethernet_lsap.h>
    53 #include <ethernet_protocols.h>
    54 #include <protocol_map.h>
    55 #include <net_device.h>
    56 #include <netif_interface.h>
    57 #include <net_interface.h>
    58 #include <nil_interface.h>
    59 #include <il_interface.h>
    60 #include <adt/measured_strings.h>
    61 #include <packet/packet_client.h>
     47#include "../../err.h"
     48#include "../../messages.h"
     49#include "../../modules.h"
     50
     51#include "../../include/byteorder.h"
     52#include "../../include/checksum.h"
     53#include "../../include/ethernet_lsap.h"
     54#include "../../include/ethernet_protocols.h"
     55#include "../../include/protocol_map.h"
     56#include "../../include/device.h"
     57#include "../../include/netif_interface.h"
     58#include "../../include/net_interface.h"
     59#include "../../include/nil_interface.h"
     60#include "../../include/il_interface.h"
     61
     62#include "../../structures/measured_strings.h"
     63#include "../../structures/packet/packet_client.h"
     64
     65#include "../nil_module.h"
    6266
    6367#include "eth.h"
    6468#include "eth_header.h"
    65 
    66 /** The module name.
    67  */
    68 #define NAME    "Ethernet protocol"
    6969
    7070/** Reserved packet prefix length.
     
    769769}
    770770
    771 #ifdef CONFIG_NETWORKING_modular
    772 
    773 #include <nil_standalone.h>
    774 
    775 /** Default thread for new connections.
    776  *
    777  *  @param[in] iid The initial message identifier.
    778  *  @param[in] icall The initial message call structure.
    779  *
    780  */
    781 static void nil_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    782 {
    783         /*
    784          * Accept the connection
    785          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    786          */
    787         ipc_answer_0(iid, EOK);
    788        
    789         while(true) {
    790                 ipc_call_t answer;
    791                 int answer_count;
    792                
    793                 /* Clear the answer structure */
    794                 refresh_answer(&answer, &answer_count);
    795                
    796                 /* Fetch the next message */
    797                 ipc_call_t call;
    798                 ipc_callid_t callid = async_get_call(&call);
    799                
    800                 /* Process the message */
    801                 int res = nil_module_message(callid, &call, &answer, &answer_count);
    802                
    803                 /* End if said to either by the message or the processing result */
    804                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    805                         return;
    806                
    807                 /* Answer the message */
    808                 answer_call(callid, res, &answer, answer_count);
    809         }
    810 }
    811 
    812 /** Starts the module.
    813  *
    814  *  @param argc The count of the command line arguments. Ignored parameter.
    815  *  @param argv The command line parameters. Ignored parameter.
    816  *
    817  *  @returns EOK on success.
    818  *  @returns Other error codes as defined for each specific module start function.
    819  *
    820  */
    821 int main(int argc, char *argv[])
    822 {
    823         ERROR_DECLARE;
    824        
    825         /* Print the module label */
    826         printf("Task %d - %s\n", task_get_id(), NAME);
    827        
    828         /* Start the module */
    829         if (ERROR_OCCURRED(nil_module_start(nil_client_connection))) {
    830                 printf(" - ERROR %i\n", ERROR_CODE);
    831                 return ERROR_CODE;
    832         }
    833        
    834         return EOK;
    835 }
    836 
    837 #endif /* CONFIG_NETWORKING_modular */
    838 
    839771/** @}
    840772 */
  • uspace/srv/net/nil/eth/eth.h

    r3aae4e8 r9f10660f  
    4141#include <ipc/services.h>
    4242
    43 #include <net_device.h>
    44 #include <adt/measured_strings.h>
     43#include "../../include/device.h"
     44#include "../../structures/measured_strings.h"
    4545
    4646/** Type definition of the Ethernet global data.
     
    147147};
    148148
    149 /** Module initialization.
    150  *  Is called by the module_start() function.
    151  *  @param[in] net_phone The networking moduel phone.
    152  *  @returns EOK on success.
    153  *  @returns Other error codes as defined for each specific module initialize function.
    154  */
    155 extern int nil_initialize(int net_phone);
    156 
    157 /** Message processing function.
    158  *  @param[in] callid The message identifier.
    159  *  @param[in] call The message parameters.
    160  *  @param[out] answer The message answer parameters.
    161  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    162  *  @returns EOK on success.
    163  *  @returns ENOTSUP if the message is not known.
    164  *  @returns Other error codes as defined for each specific module message function.
    165  *  @see nil_interface.h
    166  *  @see IS_NET_NIL_MESSAGE()
    167  */
    168 extern int nil_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    169 
    170149#endif
    171150
  • uspace/srv/net/nil/eth/eth_module.c

    r3aae4e8 r9f10660f  
    4242#include <ipc/services.h>
    4343
    44 #include <net_err.h>
    45 #include <net_modules.h>
    46 #include <net_interface.h>
    47 #include <packet/packet.h>
    48 #include <nil_standalone.h>
     44#include "../../err.h"
     45#include "../../modules.h"
     46
     47#include "../../include/net_interface.h"
     48
     49#include "../../structures/packet/packet.h"
     50
     51#include "../nil_module.h"
    4952
    5053#include "eth.h"
     54
     55/** The module name.
     56 */
     57#define NAME    "Ethernet protocol"
     58
     59/** Prints the module name.
     60 */
     61void module_print_name(void);
    5162
    5263/** Starts the Ethernet module.
     
    5869 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    5970 */
    60 int nil_module_start(async_client_conn_t client_connection){
     71int module_start(async_client_conn_t client_connection);
     72
     73/** Passes the parameters to the module specific nil_message() function.
     74 *  @param[in] callid The message identifier.
     75 *  @param[in] call The message parameters.
     76 *  @param[out] answer The message answer parameters.
     77 *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
     78 *  @returns EOK on success.
     79 *  @returns ENOTSUP if the message is not known.
     80 *  @returns Other error codes as defined for each specific module message function.
     81 */
     82int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     83
     84void module_print_name(void){
     85        printf("%s", NAME);
     86}
     87
     88int module_start(async_client_conn_t client_connection){
    6189        ERROR_DECLARE;
    6290
     
    79107}
    80108
    81 /** Passes the parameters to the module specific nil_message() function.
    82  *  @param[in] callid The message identifier.
    83  *  @param[in] call The message parameters.
    84  *  @param[out] answer The message answer parameters.
    85  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    86  *  @returns EOK on success.
    87  *  @returns ENOTSUP if the message is not known.
    88  *  @returns Other error codes as defined for each specific module message function.
    89  */
    90 int nil_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     109int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    91110        return nil_message(callid, call, answer, answer_count);
    92111}
  • uspace/srv/net/nil/nildummy/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ../..
    3031USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3332BINARY = nildummy
    3433
    3534SOURCES = \
    3635        nildummy.c \
    37         nildummy_module.c
     36        nildummy_module.c \
     37        $(NET_BASE)/module.c \
     38        $(NET_BASE)/modules.c \
     39        $(NET_BASE)/net/net_remote.c \
     40        $(NET_BASE)/netif/netif_remote.c \
     41        $(NET_BASE)/structures/measured_strings.c \
     42        $(NET_BASE)/structures/packet/packet.c \
     43        $(NET_BASE)/structures/packet/packet_client.c \
     44        $(NET_BASE)/structures/packet/packet_remote.c
    3845
    3946include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/nil/nildummy/nildummy.c

    r3aae4e8 r9f10660f  
    4545#include <ipc/services.h>
    4646
    47 #include <net_err.h>
    48 #include <net_messages.h>
    49 #include <net_modules.h>
    50 #include <net_device.h>
    51 #include <netif_interface.h>
    52 #include <nil_interface.h>
    53 #include <il_interface.h>
    54 #include <adt/measured_strings.h>
    55 #include <packet/packet.h>
    56 #include <nil_module.h>
     47#include "../../err.h"
     48#include "../../messages.h"
     49#include "../../modules.h"
     50
     51#include "../../include/device.h"
     52#include "../../include/netif_interface.h"
     53#include "../../include/nil_interface.h"
     54#include "../../include/il_interface.h"
     55
     56#include "../../structures/measured_strings.h"
     57#include "../../structures/packet/packet.h"
     58
     59#include "../nil_module.h"
    5760
    5861#include "nildummy.h"
    59 
    60 /** The module name.
    61  */
    62 #define NAME    "Dummy nil protocol"
    6362
    6463/** Default maximum transmission unit.
     
    374373}
    375374
    376 #ifdef CONFIG_NETWORKING_modular
    377 
    378 #include <nil_standalone.h>
    379 
    380 /** Default thread for new connections.
    381  *
    382  *  @param[in] iid The initial message identifier.
    383  *  @param[in] icall The initial message call structure.
    384  *
    385  */
    386 static void nil_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    387 {
    388         /*
    389          * Accept the connection
    390          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    391          */
    392         ipc_answer_0(iid, EOK);
    393        
    394         while(true) {
    395                 ipc_call_t answer;
    396                 int answer_count;
    397                
    398                 /* Clear the answer structure */
    399                 refresh_answer(&answer, &answer_count);
    400                
    401                 /* Fetch the next message */
    402                 ipc_call_t call;
    403                 ipc_callid_t callid = async_get_call(&call);
    404                
    405                 /* Process the message */
    406                 int res = nil_module_message(callid, &call, &answer, &answer_count);
    407                
    408                 /* End if said to either by the message or the processing result */
    409                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    410                         return;
    411                
    412                 /* Answer the message */
    413                 answer_call(callid, res, &answer, answer_count);
    414         }
    415 }
    416 
    417 /** Starts the module.
    418  *
    419  *  @param argc The count of the command line arguments. Ignored parameter.
    420  *  @param argv The command line parameters. Ignored parameter.
    421  *
    422  *  @returns EOK on success.
    423  *  @returns Other error codes as defined for each specific module start function.
    424  *
    425  */
    426 int main(int argc, char *argv[])
    427 {
    428         ERROR_DECLARE;
    429        
    430         /* Print the module label */
    431         printf("Task %d - %s\n", task_get_id(), NAME);
    432        
    433         /* Start the module */
    434         if (ERROR_OCCURRED(nil_module_start(nil_client_connection))) {
    435                 printf(" - ERROR %i\n", ERROR_CODE);
    436                 return ERROR_CODE;
    437         }
    438        
    439         return EOK;
    440 }
    441 
    442 #endif /* CONFIG_NETWORKING_modular */
    443 
    444375/** @}
    445376 */
  • uspace/srv/net/nil/nildummy/nildummy.h

    r3aae4e8 r9f10660f  
    4141#include <ipc/services.h>
    4242
    43 #include <net_device.h>
    44 #include <adt/measured_strings.h>
     43#include "../../include/device.h"
     44#include "../../structures/measured_strings.h"
    4545
    4646/** Type definition of the dummy nil global data.
  • uspace/srv/net/nil/nildummy/nildummy_module.c

    r3aae4e8 r9f10660f  
    4242#include <ipc/services.h>
    4343
    44 #include <net_err.h>
    45 #include <net_modules.h>
    46 #include <net_interface.h>
    47 #include <packet/packet.h>
    48 #include <nil_module.h>
    49 #include <nil_standalone.h>
     44#include "../../err.h"
     45#include "../../modules.h"
     46
     47#include "../../include/net_interface.h"
     48
     49#include "../../structures/packet/packet.h"
     50
     51#include "../nil_module.h"
    5052
    5153#include "nildummy.h"
     54
     55/** The module name.
     56 */
     57#define NAME    "Dummy nil protocol"
     58
     59/** Prints the module name.
     60 */
     61void module_print_name(void);
    5262
    5363/** Starts the dummy nil module.
     
    5969 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    6070 */
    61 int nil_module_start(async_client_conn_t client_connection){
     71int module_start(async_client_conn_t client_connection);
     72
     73/** Passes the parameters to the module specific nil_message() function.
     74 *  @param[in] callid The message identifier.
     75 *  @param[in] call The message parameters.
     76 *  @param[out] answer The message answer parameters.
     77 *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
     78 *  @returns EOK on success.
     79 *  @returns ENOTSUP if the message is not known.
     80 *  @returns Other error codes as defined for each specific module message function.
     81 */
     82int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     83
     84void module_print_name(void){
     85        printf("%s", NAME);
     86}
     87
     88int module_start(async_client_conn_t client_connection){
    6289        ERROR_DECLARE;
    6390
     
    80107}
    81108
    82 /** Passes the parameters to the module specific nil_message() function.
    83  *  @param[in] callid The message identifier.
    84  *  @param[in] call The message parameters.
    85  *  @param[out] answer The message answer parameters.
    86  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    87  *  @returns EOK on success.
    88  *  @returns ENOTSUP if the message is not known.
    89  *  @returns Other error codes as defined for each specific module message function.
    90  */
    91 int nil_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     109int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    92110        return nil_message(callid, call, answer, answer_count);
    93111}
  • uspace/srv/net/tl/icmp/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ../..
    3031USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3332BINARY = icmp
    3433
    3534SOURCES = \
    3635        icmp.c \
    37         icmp_module.c
     36        icmp_module.c \
     37        icmp_client.c \
     38        $(NET_BASE)/checksum.c \
     39        $(NET_BASE)/module.c \
     40        $(NET_BASE)/modules.c \
     41        $(NET_BASE)/il/ip/ip_client.c \
     42        $(NET_BASE)/il/ip/ip_remote.c \
     43        $(NET_BASE)/net/net_remote.c \
     44        $(NET_BASE)/structures/measured_strings.c \
     45        $(NET_BASE)/structures/packet/packet.c \
     46        $(NET_BASE)/structures/packet/packet_client.c \
     47        $(NET_BASE)/structures/packet/packet_remote.c
    3848
    3949include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/tl/icmp/icmp.c

    r3aae4e8 r9f10660f  
    4242#include <stdint.h>
    4343#include <str.h>
     44
    4445#include <ipc/ipc.h>
    4546#include <ipc/services.h>
     47
    4648#include <sys/time.h>
    4749#include <sys/types.h>
    4850
    49 #include <net_err.h>
    50 #include <net_messages.h>
    51 #include <net_modules.h>
    52 #include <packet/packet_client.h>
    53 #include <net_byteorder.h>
    54 #include <net_checksum.h>
    55 #include <icmp_api.h>
    56 #include <icmp_client.h>
    57 #include <icmp_codes.h>
    58 #include <icmp_common.h>
    59 #include <icmp_interface.h>
    60 #include <il_interface.h>
    61 #include <inet.h>
    62 #include <ip_client.h>
    63 #include <ip_interface.h>
    64 #include <ip_protocols.h>
    65 #include <net_interface.h>
    66 #include <socket_codes.h>
    67 #include <socket_errno.h>
    68 #include <tl_messages.h>
    69 #include <icmp_messages.h>
    70 #include <icmp_header.h>
     51#include "../../err.h"
     52#include "../../messages.h"
     53#include "../../modules.h"
     54
     55#include "../../structures/packet/packet_client.h"
     56
     57#include "../../include/byteorder.h"
     58#include "../../include/checksum.h"
     59#include "../../include/icmp_api.h"
     60#include "../../include/icmp_client.h"
     61#include "../../include/icmp_codes.h"
     62#include "../../include/icmp_common.h"
     63#include "../../include/icmp_interface.h"
     64#include "../../include/il_interface.h"
     65#include "../../include/inet.h"
     66#include "../../include/ip_client.h"
     67#include "../../include/ip_interface.h"
     68#include "../../include/ip_protocols.h"
     69#include "../../include/net_interface.h"
     70#include "../../include/socket_codes.h"
     71#include "../../include/socket_errno.h"
     72
     73#include "../../tl/tl_messages.h"
    7174
    7275#include "icmp.h"
     76#include "icmp_header.h"
     77#include "icmp_messages.h"
    7378#include "icmp_module.h"
    74 
    75 /** ICMP module name.
    76  */
    77 #define NAME    "ICMP protocol"
    7879
    7980/** Default ICMP error reporting.
     
    819820}
    820821
    821 #ifdef CONFIG_NETWORKING_modular
    822 
    823 #include <tl_standalone.h>
    824 
    825 /** Default thread for new connections.
    826  *
    827  *  @param[in] iid The initial message identifier.
    828  *  @param[in] icall The initial message call structure.
    829  *
    830  */
    831 static void tl_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    832 {
    833         /*
    834          * Accept the connection
    835          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    836          */
    837         ipc_answer_0(iid, EOK);
    838        
    839         while(true) {
    840                 ipc_call_t answer;
    841                 int answer_count;
    842                
    843                 /* Clear the answer structure */
    844                 refresh_answer(&answer, &answer_count);
    845                
    846                 /* Fetch the next message */
    847                 ipc_call_t call;
    848                 ipc_callid_t callid = async_get_call(&call);
    849                
    850                 /* Process the message */
    851                 int res = tl_module_message(callid, &call, &answer, &answer_count);
    852                
    853                 /* End if said to either by the message or the processing result */
    854                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    855                         return;
    856                
    857                 /* Answer the message */
    858                 answer_call(callid, res, &answer, answer_count);
    859         }
    860 }
    861 
    862 /** Starts the module.
    863  *
    864  *  @param argc The count of the command line arguments. Ignored parameter.
    865  *  @param argv The command line parameters. Ignored parameter.
    866  *
    867  *  @returns EOK on success.
    868  *  @returns Other error codes as defined for each specific module start function.
    869  *
    870  */
    871 int main(int argc, char *argv[])
    872 {
    873         ERROR_DECLARE;
    874        
    875         /* Print the module label */
    876         printf("Task %d - %s\n", task_get_id(), NAME);
    877        
    878         /* Start the module */
    879         if (ERROR_OCCURRED(tl_module_start(tl_client_connection))) {
    880                 printf(" - ERROR %i\n", ERROR_CODE);
    881                 return ERROR_CODE;
    882         }
    883        
    884         return EOK;
    885 }
    886 
    887 #endif /* CONFIG_NETWORKING_modular */
    888 
    889822/** @}
    890823 */
  • uspace/srv/net/tl/icmp/icmp.h

    r3aae4e8 r9f10660f  
    4040#include <fibril_synch.h>
    4141
    42 #include <icmp_codes.h>
    43 #include <adt/int_map.h>
    44 #include <icmp_header.h>
     42#include "../../include/icmp_codes.h"
     43
     44#include "../../structures/int_map.h"
     45
     46#include "icmp_header.h"
    4547
    4648/** Type definition of the ICMP reply data.
  • uspace/srv/net/tl/icmp/icmp_module.c

    r3aae4e8 r9f10660f  
    4040#include <async.h>
    4141#include <stdio.h>
     42
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    46 #include <net_modules.h>
    47 #include <packet/packet.h>
    48 #include <net_interface.h>
    49 #include <tl_standalone.h>
     46#include "../../err.h"
     47#include "../../modules.h"
     48
     49#include "../../structures/packet/packet.h"
     50
     51#include "../../include/net_interface.h"
    5052
    5153#include "icmp.h"
    5254#include "icmp_module.h"
    5355
    54 /** ICMP module global data.
     56/** ICMP module name.
    5557 */
    56 extern icmp_globals_t   icmp_globals;
     58#define NAME    "ICMP protocol"
     59
     60/** Prints the module name.
     61 *  @see NAME
     62 */
     63void module_print_name(void);
    5764
    5865/** Starts the ICMP module.
     
    6370 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    6471 */
    65 int tl_module_start(async_client_conn_t client_connection){
     72int module_start(async_client_conn_t client_connection);
     73
     74/** Processes the ICMP message.
     75 *  @param[in] callid The message identifier.
     76 *  @param[in] call The message parameters.
     77 *  @param[out] answer The message answer parameters.
     78 *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
     79 *  @returns EOK on success.
     80 *  @returns Other error codes as defined for the icmp_message() function.
     81 */
     82int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     83
     84/** ICMP module global data.
     85 */
     86extern icmp_globals_t   icmp_globals;
     87
     88void module_print_name(void){
     89        printf("%s", NAME);
     90}
     91
     92int module_start(async_client_conn_t client_connection){
    6693        ERROR_DECLARE;
    6794
     
    86113}
    87114
    88 /** Processes the ICMP message.
    89  *  @param[in] callid The message identifier.
    90  *  @param[in] call The message parameters.
    91  *  @param[out] answer The message answer parameters.
    92  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    93  *  @returns EOK on success.
    94  *  @returns Other error codes as defined for the icmp_message() function.
    95  */
    96 int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     115int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    97116        return icmp_message(callid, call, answer, answer_count);
    98117}
  • uspace/srv/net/tl/tcp/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ../..
    3031USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3332BINARY = tcp
    3433
    3534SOURCES = \
    3635        tcp.c \
    37         tcp_module.c
     36        tcp_module.c \
     37        $(NET_BASE)/checksum.c \
     38        $(NET_BASE)/module.c \
     39        $(NET_BASE)/modules.c \
     40        $(NET_BASE)/il/ip/ip_client.c \
     41        $(NET_BASE)/il/ip/ip_remote.c \
     42        $(NET_BASE)/net/net_remote.c \
     43        $(NET_BASE)/socket/socket_core.c \
     44        $(NET_BASE)/tl/icmp/icmp_client.c \
     45        $(NET_BASE)/tl/icmp/icmp_common.c \
     46        $(NET_BASE)/tl/icmp/icmp_remote.c \
     47        $(NET_BASE)/tl/tl_common.c \
     48        $(NET_BASE)/structures/char_map.c \
     49        $(NET_BASE)/structures/dynamic_fifo.c \
     50        $(NET_BASE)/structures/measured_strings.c \
     51        $(NET_BASE)/structures/packet/packet.c \
     52        $(NET_BASE)/structures/packet/packet_client.c \
     53        $(NET_BASE)/structures/packet/packet_remote.c
    3854
    3955include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/tl/tcp/tcp.c

    r3aae4e8 r9f10660f  
    4646#include <ipc/services.h>
    4747
    48 #include <net_err.h>
    49 #include <net_messages.h>
    50 #include <net_modules.h>
    51 #include <adt/dynamic_fifo.h>
    52 #include <packet/packet_client.h>
    53 #include <net_checksum.h>
    54 #include <in.h>
    55 #include <in6.h>
    56 #include <inet.h>
    57 #include <ip_client.h>
    58 #include <ip_interface.h>
    59 #include <ip_protocols.h>
    60 #include <icmp_client.h>
    61 #include <icmp_interface.h>
    62 #include <net_interface.h>
    63 #include <socket_codes.h>
    64 #include <socket_errno.h>
    65 #include <tcp_codes.h>
    66 #include <socket_core.h>
    67 #include <socket_messages.h>
    68 #include <tl_common.h>
    69 #include <tl_messages.h>
     48#include "../../err.h"
     49#include "../../messages.h"
     50#include "../../modules.h"
     51
     52#include "../../structures/dynamic_fifo.h"
     53#include "../../structures/packet/packet_client.h"
     54
     55#include "../../include/checksum.h"
     56#include "../../include/in.h"
     57#include "../../include/in6.h"
     58#include "../../include/inet.h"
     59#include "../../include/ip_client.h"
     60#include "../../include/ip_interface.h"
     61#include "../../include/ip_protocols.h"
     62#include "../../include/icmp_client.h"
     63#include "../../include/icmp_interface.h"
     64#include "../../include/net_interface.h"
     65#include "../../include/socket_codes.h"
     66#include "../../include/socket_errno.h"
     67#include "../../include/tcp_codes.h"
     68
     69#include "../../socket/socket_core.h"
     70#include "../../socket/socket_messages.h"
     71
     72#include "../tl_common.h"
     73#include "../tl_messages.h"
    7074
    7175#include "tcp.h"
    7276#include "tcp_header.h"
    7377#include "tcp_module.h"
    74 
    75 /** TCP module name.
    76  */
    77 #define NAME    "TCP protocol"
    7878
    7979/** The TCP window default value.
     
    19971997}
    19981998
    1999 #ifdef CONFIG_NETWORKING_modular
    2000 
    2001 #include <tl_standalone.h>
    2002 
    2003 /** Default thread for new connections.
    2004  *
    2005  *  @param[in] iid The initial message identifier.
    2006  *  @param[in] icall The initial message call structure.
    2007  *
    2008  */
    2009 static void tl_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    2010 {
    2011         /*
    2012          * Accept the connection
    2013          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    2014          */
    2015         ipc_answer_0(iid, EOK);
    2016        
    2017         while(true) {
    2018                 ipc_call_t answer;
    2019                 int answer_count;
    2020                
    2021                 /* Clear the answer structure */
    2022                 refresh_answer(&answer, &answer_count);
    2023                
    2024                 /* Fetch the next message */
    2025                 ipc_call_t call;
    2026                 ipc_callid_t callid = async_get_call(&call);
    2027                
    2028                 /* Process the message */
    2029                 int res = tl_module_message(callid, &call, &answer, &answer_count);
    2030                
    2031                 /* End if said to either by the message or the processing result */
    2032                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    2033                         return;
    2034                
    2035                 /* Answer the message */
    2036                 answer_call(callid, res, &answer, answer_count);
    2037         }
    2038 }
    2039 
    2040 /** Starts the module.
    2041  *
    2042  *  @param argc The count of the command line arguments. Ignored parameter.
    2043  *  @param argv The command line parameters. Ignored parameter.
    2044  *
    2045  *  @returns EOK on success.
    2046  *  @returns Other error codes as defined for each specific module start function.
    2047  *
    2048  */
    2049 int main(int argc, char *argv[])
    2050 {
    2051         ERROR_DECLARE;
    2052        
    2053         /* Print the module label */
    2054         printf("Task %d - %s\n", task_get_id(), NAME);
    2055        
    2056         /* Start the module */
    2057         if (ERROR_OCCURRED(tl_module_start(tl_client_connection))) {
    2058                 printf(" - ERROR %i\n", ERROR_CODE);
    2059                 return ERROR_CODE;
    2060         }
    2061        
    2062         return EOK;
    2063 }
    2064 
    2065 #endif /* CONFIG_NETWORKING_modular */
    2066 
    20671999/** @}
    20682000 */
  • uspace/srv/net/tl/tcp/tcp.h

    r3aae4e8 r9f10660f  
    4040#include <fibril_synch.h>
    4141
    42 #include <packet/packet.h>
    43 #include <net_device.h>
    44 #include <socket_core.h>
    45 #include <tl_common.h>
     42#include "../../structures/packet/packet.h"
     43
     44#include "../../include/device.h"
     45
     46#include "../../socket/socket_core.h"
     47
     48#include "../tl_common.h"
    4649
    4750/** Type definition of the TCP global data.
  • uspace/srv/net/tl/tcp/tcp_module.c

    r3aae4e8 r9f10660f  
    4040#include <async.h>
    4141#include <stdio.h>
     42
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    46 #include <net_modules.h>
    47 #include <packet/packet.h>
    48 #include <net_interface.h>
    49 #include <ip_protocols.h>
    50 #include <ip_interface.h>
    51 #include <tl_standalone.h>
     46#include "../../err.h"
     47#include "../../modules.h"
     48
     49#include "../../structures/packet/packet.h"
     50
     51#include "../../include/net_interface.h"
     52#include "../../include/ip_protocols.h"
     53#include "../../include/ip_interface.h"
    5254
    5355#include "tcp.h"
    5456#include "tcp_module.h"
    5557
    56 /** TCP module global data.
     58/** TCP module name.
    5759 */
    58 extern tcp_globals_t    tcp_globals;
     60#define NAME    "TCP protocol"
     61
     62/** Prints the module name.
     63 *  @see NAME
     64 */
     65void module_print_name(void);
    5966
    6067/** Starts the TCP module.
     
    6572 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    6673 */
    67 int tl_module_start(async_client_conn_t client_connection){
     74int module_start(async_client_conn_t client_connection);
     75
     76/** Processes the TCP message.
     77 *  @param[in] callid The message identifier.
     78 *  @param[in] call The message parameters.
     79 *  @param[out] answer The message answer parameters.
     80 *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
     81 *  @returns EOK on success.
     82 *  @returns Other error codes as defined for the tcp_message() function.
     83 */
     84int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     85
     86/** TCP module global data.
     87 */
     88extern tcp_globals_t    tcp_globals;
     89
     90void module_print_name(void){
     91        printf("%s", NAME);
     92}
     93
     94int module_start(async_client_conn_t client_connection){
    6895        ERROR_DECLARE;
    6996
     
    85112}
    86113
    87 /** Processes the TCP message.
    88  *  @param[in] callid The message identifier.
    89  *  @param[in] call The message parameters.
    90  *  @param[out] answer The message answer parameters.
    91  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    92  *  @returns EOK on success.
    93  *  @returns Other error codes as defined for the tcp_message() function.
    94  */
    95 int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     114int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    96115        return tcp_message(callid, call, answer, answer_count);
    97116}
  • uspace/srv/net/tl/tcp/tcp_module.h

    r3aae4e8 r9f10660f  
    4747 *  @returns ENOMEM if there is not enough memory left.
    4848 */
    49 extern int tcp_initialize(async_client_conn_t client_connection);
     49int tcp_initialize(async_client_conn_t client_connection);
    5050
    5151/** Processes the TCP message.
     
    5959 *  @see IS_NET_TCP_MESSAGE()
    6060 */
    61 extern int tcp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     61int tcp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    6262
    6363#endif
  • uspace/srv/net/tl/udp/Makefile

    r3aae4e8 r9f10660f  
    2828#
    2929
     30NET_BASE = ../..
    3031USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3332BINARY = udp
    3433
    3534SOURCES = \
    3635        udp.c \
    37         udp_module.c
     36        udp_module.c \
     37        $(NET_BASE)/checksum.c \
     38        $(NET_BASE)/module.c \
     39        $(NET_BASE)/modules.c \
     40        $(NET_BASE)/il/ip/ip_client.c \
     41        $(NET_BASE)/il/ip/ip_remote.c \
     42        $(NET_BASE)/net/net_remote.c \
     43        $(NET_BASE)/socket/socket_core.c \
     44        $(NET_BASE)/tl/icmp/icmp_client.c \
     45        $(NET_BASE)/tl/icmp/icmp_common.c \
     46        $(NET_BASE)/tl/icmp/icmp_remote.c \
     47        $(NET_BASE)/tl/tl_common.c \
     48        $(NET_BASE)/structures/char_map.c \
     49        $(NET_BASE)/structures/dynamic_fifo.c \
     50        $(NET_BASE)/structures/measured_strings.c \
     51        $(NET_BASE)/structures/packet/packet.c \
     52        $(NET_BASE)/structures/packet/packet_client.c \
     53        $(NET_BASE)/structures/packet/packet_remote.c
    3854
    3955include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/net/tl/udp/udp.c

    r3aae4e8 r9f10660f  
    4040#include <malloc.h>
    4141#include <stdio.h>
     42
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    46 #include <net_messages.h>
    47 #include <net_modules.h>
    48 #include <adt/dynamic_fifo.h>
    49 #include <packet/packet_client.h>
    50 #include <net_checksum.h>
    51 #include <in.h>
    52 #include <in6.h>
    53 #include <inet.h>
    54 #include <ip_client.h>
    55 #include <ip_interface.h>
    56 #include <ip_protocols.h>
    57 #include <icmp_client.h>
    58 #include <icmp_interface.h>
    59 #include <net_interface.h>
    60 #include <socket_codes.h>
    61 #include <socket_errno.h>
    62 #include <socket_core.h>
    63 #include <socket_messages.h>
    64 #include <tl_common.h>
    65 #include <tl_messages.h>
     46#include "../../err.h"
     47#include "../../messages.h"
     48#include "../../modules.h"
     49
     50#include "../../structures/dynamic_fifo.h"
     51#include "../../structures/packet/packet_client.h"
     52
     53#include "../../include/checksum.h"
     54#include "../../include/in.h"
     55#include "../../include/in6.h"
     56#include "../../include/inet.h"
     57#include "../../include/ip_client.h"
     58#include "../../include/ip_interface.h"
     59#include "../../include/ip_protocols.h"
     60#include "../../include/icmp_client.h"
     61#include "../../include/icmp_interface.h"
     62#include "../../include/net_interface.h"
     63#include "../../include/socket_codes.h"
     64#include "../../include/socket_errno.h"
     65
     66#include "../../socket/socket_core.h"
     67#include "../../socket/socket_messages.h"
     68
     69#include "../tl_common.h"
     70#include "../tl_messages.h"
    6671
    6772#include "udp.h"
    6873#include "udp_header.h"
    6974#include "udp_module.h"
    70 
    71 /** UDP module name.
    72  */
    73 #define NAME    "UDP protocol"
    7475
    7576/** Default UDP checksum computing.
     
    699700}
    700701
    701 #ifdef CONFIG_NETWORKING_modular
    702 
    703 #include <tl_standalone.h>
    704 
    705 /** Default thread for new connections.
    706  *
    707  *  @param[in] iid The initial message identifier.
    708  *  @param[in] icall The initial message call structure.
    709  *
    710  */
    711 static void tl_client_connection(ipc_callid_t iid, ipc_call_t * icall)
    712 {
    713         /*
    714          * Accept the connection
    715          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    716          */
    717         ipc_answer_0(iid, EOK);
    718        
    719         while(true) {
    720                 ipc_call_t answer;
    721                 int answer_count;
    722                
    723                 /* Clear the answer structure */
    724                 refresh_answer(&answer, &answer_count);
    725                
    726                 /* Fetch the next message */
    727                 ipc_call_t call;
    728                 ipc_callid_t callid = async_get_call(&call);
    729                
    730                 /* Process the message */
    731                 int res = tl_module_message(callid, &call, &answer, &answer_count);
    732                
    733                 /* End if said to either by the message or the processing result */
    734                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
    735                         return;
    736                
    737                 /* Answer the message */
    738                 answer_call(callid, res, &answer, answer_count);
    739         }
    740 }
    741 
    742 /** Starts the module.
    743  *
    744  *  @param argc The count of the command line arguments. Ignored parameter.
    745  *  @param argv The command line parameters. Ignored parameter.
    746  *
    747  *  @returns EOK on success.
    748  *  @returns Other error codes as defined for each specific module start function.
    749  *
    750  */
    751 int main(int argc, char *argv[])
    752 {
    753         ERROR_DECLARE;
    754        
    755         /* Print the module label */
    756         printf("Task %d - %s\n", task_get_id(), NAME);
    757        
    758         /* Start the module */
    759         if (ERROR_OCCURRED(tl_module_start(tl_client_connection))) {
    760                 printf(" - ERROR %i\n", ERROR_CODE);
    761                 return ERROR_CODE;
    762         }
    763        
    764         return EOK;
    765 }
    766 
    767 #endif /* CONFIG_NETWORKING_modular */
    768 
    769702/** @}
    770703 */
  • uspace/srv/net/tl/udp/udp.h

    r3aae4e8 r9f10660f  
    3939
    4040#include <fibril_synch.h>
    41 #include <socket_core.h>
    42 #include <tl_common.h>
     41
     42#include "../../socket/socket_core.h"
     43
     44#include "../tl_common.h"
    4345
    4446/** Type definition of the UDP global data.
  • uspace/srv/net/tl/udp/udp_module.c

    r3aae4e8 r9f10660f  
    4040#include <async.h>
    4141#include <stdio.h>
     42
    4243#include <ipc/ipc.h>
    4344#include <ipc/services.h>
    4445
    45 #include <net_err.h>
    46 #include <net_modules.h>
    47 #include <packet/packet.h>
    48 #include <net_interface.h>
    49 #include <tl_standalone.h>
     46#include "../../err.h"
     47#include "../../modules.h"
     48
     49#include "../../structures/packet/packet.h"
     50
     51#include "../../include/net_interface.h"
    5052
    5153#include "udp.h"
    5254#include "udp_module.h"
    5355
    54 /** UDP module global data.
     56/** UDP module name.
    5557 */
    56 extern udp_globals_t    udp_globals;
     58#define NAME    "UDP protocol"
     59
     60/** Prints the module name.
     61 *  @see NAME
     62 */
     63void module_print_name(void);
    5764
    5865/** Starts the UDP module.
     
    6370 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    6471 */
    65 int tl_module_start(async_client_conn_t client_connection){
     72int module_start(async_client_conn_t client_connection);
     73
     74/** Processes the UDP message.
     75 *  @param[in] callid The message identifier.
     76 *  @param[in] call The message parameters.
     77 *  @param[out] answer The message answer parameters.
     78 *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
     79 *  @returns EOK on success.
     80 *  @returns Other error codes as defined for the udp_message() function.
     81 */
     82int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     83
     84/** UDP module global data.
     85 */
     86extern udp_globals_t    udp_globals;
     87
     88void module_print_name(void){
     89        printf("%s", NAME);
     90}
     91
     92int module_start(async_client_conn_t client_connection){
    6693        ERROR_DECLARE;
    6794
     
    86113}
    87114
    88 /** Processes the UDP message.
    89  *  @param[in] callid The message identifier.
    90  *  @param[in] call The message parameters.
    91  *  @param[out] answer The message answer parameters.
    92  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    93  *  @returns EOK on success.
    94  *  @returns Other error codes as defined for the udp_message() function.
    95  */
    96 int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     115int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    97116        return udp_message(callid, call, answer, answer_count);
    98117}
  • uspace/srv/net/tl/udp/udp_module.h

    r3aae4e8 r9f10660f  
    4747 *  @returns ENOMEM if there is not enough memory left.
    4848 */
    49 extern int udp_initialize(async_client_conn_t client_connection);
     49int udp_initialize(async_client_conn_t client_connection);
    5050
    5151/** Processes the UDP message.
     
    5959 *  @see IS_NET_UDP_MESSAGE()
    6060 */
    61 extern int udp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     61int udp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    6262
    6363#endif
Note: See TracChangeset for help on using the changeset viewer.