~jsvoboda/helenos/dnsr

« back to all changes in this revision

Viewing changes to uspace/srv/net/inetsrv/inetsrv.c

  • Committer: Jiri Svoboda
  • Date: 2012-11-11 21:31:03 UTC
  • mfrom: (1527.1.178 mainline)
  • Revision ID: jiri@wiwaxia-20121111213103-314bmkettwvlwj97
MergeĀ mainlineĀ changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
static int inet_init(void)
67
67
{
68
 
        log_msg(LVL_DEBUG, "inet_init()");
 
68
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_init()");
69
69
        
70
70
        async_set_client_connection(inet_client_conn);
71
71
        
72
72
        int rc = loc_server_register(NAME);
73
73
        if (rc != EOK) {
74
 
                log_msg(LVL_ERROR, "Failed registering server (%d).", rc);
 
74
                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server (%d).", rc);
75
75
                return EEXIST;
76
76
        }
77
77
        
79
79
        rc = loc_service_register_with_iface(SERVICE_NAME_INET, &sid,
80
80
            INET_PORT_DEFAULT);
81
81
        if (rc != EOK) {
82
 
                log_msg(LVL_ERROR, "Failed registering service (%d).", rc);
 
82
                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc);
83
83
                return EEXIST;
84
84
        }
85
85
        
86
86
        rc = loc_service_register_with_iface(SERVICE_NAME_INETCFG, &sid,
87
87
            INET_PORT_CFG);
88
88
        if (rc != EOK) {
89
 
                log_msg(LVL_ERROR, "Failed registering service (%d).", rc);
 
89
                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc);
90
90
                return EEXIST;
91
91
        }
92
92
        
93
93
        rc = loc_service_register_with_iface(SERVICE_NAME_INETPING, &sid,
94
94
            INET_PORT_PING);
95
95
        if (rc != EOK) {
96
 
                log_msg(LVL_ERROR, "Failed registering service (%d).", rc);
 
96
                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc);
97
97
                return EEXIST;
98
98
        }
99
99
        
107
107
static void inet_callback_create_srv(inet_client_t *client, ipc_callid_t callid,
108
108
    ipc_call_t *call)
109
109
{
110
 
        log_msg(LVL_DEBUG, "inet_callback_create_srv()");
 
110
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_callback_create_srv()");
111
111
 
112
112
        async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE);
113
113
        if (sess == NULL) {
142
142
        }
143
143
 
144
144
        if (dir->aobj == NULL) {
145
 
                log_msg(LVL_DEBUG, "inet_send: No route to destination.");
 
145
                log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_send: No route to destination.");
146
146
                return ENOENT;
147
147
        }
148
148
 
193
193
        inet_addr_t local;
194
194
        int rc;
195
195
 
196
 
        log_msg(LVL_DEBUG, "inet_get_srcaddr_srv()");
 
196
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srcaddr_srv()");
197
197
 
198
198
        remote.ipv4 = IPC_GET_ARG1(*call);
199
199
        tos = IPC_GET_ARG2(*call);
211
211
        int df;
212
212
        int rc;
213
213
 
214
 
        log_msg(LVL_DEBUG, "inet_send_srv()");
 
214
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_send_srv()");
215
215
 
216
216
        dgram.src.ipv4 = IPC_GET_ARG1(*call);
217
217
        dgram.dest.ipv4 = IPC_GET_ARG2(*call);
237
237
        sysarg_t proto;
238
238
 
239
239
        proto = IPC_GET_ARG1(*call);
240
 
        log_msg(LVL_DEBUG, "inet_set_proto_srv(%lu)", (unsigned long) proto);
 
240
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_set_proto_srv(%lu)", (unsigned long) proto);
241
241
 
242
242
        if (proto > UINT8_MAX) {
243
243
                async_answer_0(callid, EINVAL);
271
271
{
272
272
        inet_client_t client;
273
273
 
274
 
        log_msg(LVL_DEBUG, "inet_default_conn()");
 
274
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_default_conn()");
275
275
 
276
276
        /* Accept the connection */
277
277
        async_answer_0(iid, EOK);
377
377
{
378
378
        inet_client_t *client;
379
379
 
380
 
        log_msg(LVL_DEBUG, "inet_recv_dgram_local()");
 
380
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_recv_dgram_local()");
381
381
 
382
382
        /* ICMP messages are handled internally */
383
383
        if (proto == IP_PROTO_ICMP)
385
385
 
386
386
        client = inet_client_find(proto);
387
387
        if (client == NULL) {
388
 
                log_msg(LVL_DEBUG, "No client found for protocol 0x%" PRIx8,
 
388
                log_msg(LOG_DEFAULT, LVL_DEBUG, "No client found for protocol 0x%" PRIx8,
389
389
                    proto);
390
390
                return ENOENT;
391
391
        }
427
427
 
428
428
        printf(NAME ": HelenOS Internet Protocol service\n");
429
429
 
430
 
        if (log_init(NAME, LVL_WARN) != EOK) {
 
430
        if (log_init(NAME) != EOK) {
431
431
                printf(NAME ": Failed to initialize logging.\n");
432
432
                return 1;
433
433
        }