Changeset 5d1cb8a in mainline


Ignore:
Timestamp:
2013-05-03T21:11:23Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4e716180
Parents:
8fdb18e
Message:

DNS configuration utility.

Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    r8fdb18e r5d1cb8a  
    166166        $(USPACE_PATH)/app/dltest2/dltest2 \
    167167        $(USPACE_PATH)/app/dload/dload \
     168        $(USPACE_PATH)/app/dnscfg/dnscfg \
    168169        $(USPACE_PATH)/app/dnsres/dnsres \
    169170        $(USPACE_PATH)/app/edit/edit \
  • uspace/Makefile

    r8fdb18e r5d1cb8a  
    3939        app/bnchmark \
    4040        app/devctl \
     41        app/dnscfg \
    4142        app/dnsres \
    4243        app/edit \
  • uspace/srv/net/dnsrsrv/dnsrsrv.c

    r8fdb18e r5d1cb8a  
    114114    ipc_call_t *call)
    115115{
    116 //      inet_addr_t remote;
    117 //      uint8_t tos;
    118 //      inet_addr_t local;
    119 //      int rc;
    120 
    121116        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srvaddr_srv()");
    122 
    123 /*      remote.ipv4 = IPC_GET_ARG1(*call);
    124         tos = IPC_GET_ARG2(*call);
    125         local.ipv4 = 0;
    126 
    127         rc = inet_get_srcaddr(&remote, tos, &local);*/
    128         async_answer_1(callid, EOK, 0x01020304);
     117        async_answer_1(callid, EOK, dns_server_addr.ipv4);
    129118}
    130119
     
    132121    ipc_call_t *call)
    133122{
    134 //      inet_addr_t naddr;
    135 //      int rc;
    136 
    137123        log_msg(LOG_DEFAULT, LVL_DEBUG, "dnsr_set_srvaddr_srv()");
    138124
    139 //      naddr.ipv4 = IPC_GET_ARG1(*call);
     125        dns_server_addr.ipv4 = IPC_GET_ARG1(*call);
    140126
    141         /*rc = inet_get_srcaddr(&remote, tos, &local);*/
    142127        async_answer_0(callid, EOK);
    143128}
     
    151136        /* Accept the connection */
    152137        async_answer_0(iid, EOK);
    153 
    154 //      inet_client_init(&client);
    155138
    156139        while (true) {
     
    179162                }
    180163        }
    181 
    182 //      inet_client_fini(&client);
    183164}
    184165
  • uspace/srv/net/dnsrsrv/transport.c

    r8fdb18e r5d1cb8a  
    4949
    5050#define RECV_BUF_SIZE 4096
     51#define DNS_SERVER_PORT 53
    5152
    5253/** Request timeout (microseconds) */
     
    6869static fid_t recv_fid;
    6970static int transport_fd = -1;
     71inet_addr_t dns_server_addr;
    7072
    7173/** Outstanding requests */
     
    187189
    188190        addr.sin_family = AF_INET;
    189         addr.sin_port = htons(53);
    190         addr.sin_addr.s_addr = htonl((10 << 24) | (0 << 16) | (0 << 8) | 138);
     191        addr.sin_port = htons(DNS_SERVER_PORT);
     192        addr.sin_addr.s_addr = host2uint32_t_be(dns_server_addr.ipv4);
    191193
    192194        rc = dns_message_encode(req, &req_data, &req_size);
  • uspace/srv/net/dnsrsrv/transport.h

    r8fdb18e r5d1cb8a  
    3737#define TRANSPORT_H
    3838
     39#include <inet/addr.h>
    3940#include "dns_type.h"
    4041
     
    4344extern int dns_request(dns_message_t *, dns_message_t **);
    4445
     46extern inet_addr_t dns_server_addr;
     47
     48
    4549#endif
    4650
Note: See TracChangeset for help on using the changeset viewer.