Changeset 5353f50 in mainline


Ignore:
Timestamp:
2019-08-07T11:05:55Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
8ae8262
Parents:
7cce333
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-11-11 23:25:01)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-07 11:05:55)
Message:

net: Start network service on boot

  • Create unit files
  • Create network.tgt
  • Enable autostart of directly brokered net services

Conflicts:

boot/Makefile.common
uspace/lib/c/generic/inet.c
uspace/lib/c/generic/inet/tcp.c
uspace/lib/c/generic/inetping.c
uspace/lib/c/include/ipc/services.h
uspace/srv/net/loopip/loopip.c

Files:
9 added
7 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    r7cce333 r5353f50  
    261261        $(USPACE_PATH)/app/bdsh/test-bdsh \
    262262        $(USPACE_PATH)/srv/net/tcp/test-tcp \
    263         $(USPACE_PATH)/srv/volsrv/test-volsrv \
     263        $(USPACE_PATH)/srv/volsrv/test-volsrv
    264264
    265265RD_DATA_ESSENTIAL = \
  • uspace/cfg/sysman/default.tgt

    r7cce333 r5353f50  
    11[Unit]
    22After = vlaunch.svc barber.svc
     3; TODO change to Requires
     4After = network.tgt
  • uspace/lib/c/generic/inet.c

    r7cce333 r5353f50  
    8383
    8484        rc = loc_service_get_id(SERVICE_NAME_INET, &inet_svc,
    85             IPC_FLAG_BLOCKING);
     85            IPC_AUTOSTART);
    8686        if (rc != EOK)
    8787                return ENOENT;
    8888
    8989        inet_sess = loc_service_connect(inet_svc, INTERFACE_INET,
    90             IPC_FLAG_BLOCKING);
     90            IPC_AUTOSTART);
    9191        if (inet_sess == NULL)
    9292                return ENOENT;
  • uspace/lib/c/generic/inet/tcp.c

    r7cce333 r5353f50  
    106106
    107107        rc = loc_service_get_id(SERVICE_NAME_TCP, &tcp_svcid,
    108             IPC_FLAG_BLOCKING);
     108            IPC_AUTOSTART);
    109109        if (rc != EOK) {
    110110                rc = EIO;
     
    113113
    114114        tcp->sess = loc_service_connect(tcp_svcid, INTERFACE_TCP,
    115             IPC_FLAG_BLOCKING);
     115            IPC_AUTOSTART);
    116116        if (tcp->sess == NULL) {
    117117                rc = EIO;
  • uspace/lib/c/generic/inetping.c

    r7cce333 r5353f50  
    5454
    5555        rc = loc_service_get_id(SERVICE_NAME_INET, &inetping_svc,
    56             IPC_FLAG_BLOCKING);
     56            IPC_AUTOSTART);
    5757        if (rc != EOK)
    5858                return ENOENT;
    5959
    6060        inetping_sess = loc_service_connect(inetping_svc, INTERFACE_INETPING,
    61             IPC_FLAG_BLOCKING);
     61            IPC_AUTOSTART);
     62
    6263        if (inetping_sess == NULL)
    6364                return ENOENT;
  • uspace/lib/c/include/ipc/services.h

    r7cce333 r5353f50  
    6262#define SERVICE_NAME_UDP      "net/udp"
    6363#define SERVICE_NAME_TCP      "net/tcp"
     64#define SERVICE_NAME_LOOPBACK   "net/loopback"
    6465#define SERVICE_NAME_VBD      "vbd"
    6566#define SERVICE_NAME_VOLSRV   "volsrv"
     67
    6668
    6769#define LOC_DEVICE_NAMESPACE         "devices"
  • uspace/srv/net/loopip/loopip.c

    r7cce333 r5353f50  
    4343#include <io/log.h>
    4444#include <loc.h>
     45#include <ipc/services.h>
    4546#include <stdio.h>
    4647#include <stdlib.h>
     
    115116
    116117        prodcons_initialize(&loopip_rcv_queue);
    117 
    118         const char *svc_name = "net/loopback";
     118       
     119        const char *svc_name = SERVICE_NAME_LOOPBACK;
    119120        service_id_t sid;
    120121        rc = loc_service_register(svc_name, &sid);
Note: See TracChangeset for help on using the changeset viewer.