Changeset 0e25780 in mainline for uspace/srv


Ignore:
Timestamp:
2012-03-07T21:01:10Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
45aa22c
Parents:
3d016ac
Message:

Inetcfg skeleton.

Location:
uspace/srv/inet
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/inet/Makefile

    r3d016ac r0e25780  
    3434        inet.c \
    3535        inet_link.c \
     36        inetcfg.c \
    3637        pdu.c
    3738
  • uspace/srv/inet/inet.c

    r3d016ac r0e25780  
    4949#include "addrobj.h"
    5050#include "inet.h"
     51#include "inetcfg.h"
    5152#include "inet_link.h"
    5253
     
    7374        }
    7475
    75         rc = loc_service_register(SERVICE_NAME_INET, &sid);
     76        rc = loc_service_register_with_iface(SERVICE_NAME_INET, &sid,
     77            INET_PORT_DEFAULT);
     78        if (rc != EOK) {
     79                log_msg(LVL_ERROR, "Failed registering service (%d).", rc);
     80                return EEXIST;
     81        }
     82
     83        rc = loc_service_register_with_iface(SERVICE_NAME_INETCFG, &sid,
     84            INET_PORT_CFG);
    7685        if (rc != EOK) {
    7786                log_msg(LVL_ERROR, "Failed registering service (%d).", rc);
     
    220229}
    221230
    222 static void inet_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     231static void inet_default_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    223232{
    224233        inet_client_t client;
    225234
    226         log_msg(LVL_DEBUG, "inet_client_conn()");
     235        log_msg(LVL_DEBUG, "inet_default_conn()");
    227236
    228237        /* Accept the connection */
     
    263272}
    264273
     274static void inet_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     275{
     276        sysarg_t port;
     277
     278        log_msg(LVL_DEBUG, "inet_client_conn(%d, %d, %d)",
     279        (int)IPC_GET_ARG1(*icall), (int)IPC_GET_ARG2(*icall),
     280        (int)IPC_GET_ARG3(*icall));
     281
     282        port = IPC_GET_ARG1(*icall);
     283
     284        switch (port) {
     285        case INET_PORT_DEFAULT:
     286                inet_default_conn(iid, icall, arg);
     287                break;
     288        case INET_PORT_CFG:
     289                inet_cfg_conn(iid, icall, arg);
     290                break;
     291        default:
     292                printf("uknown port number %d\n", port);
     293                async_answer_0(iid, ENOTSUP);
     294                break;
     295        }
     296}
     297
    265298static inet_client_t *inet_client_find(uint8_t proto)
    266299{
  • uspace/srv/inet/inet.h

    r3d016ac r0e25780  
    6464} inet_naddr_t;
    6565
     66/** Address object info */
     67typedef struct {
     68        /** Network address */
     69        inet_naddr_t naddr;
     70} inet_addr_info_t;
     71
     72/** IP link info */
     73typedef struct {
     74        int dummy;
     75} inet_link_info_t;
     76
    6677typedef struct {
    6778        inet_addr_t src;
Note: See TracChangeset for help on using the changeset viewer.