~jsvoboda/helenos/dnsr

« back to all changes in this revision

Viewing changes to uspace/srv/net/inetsrv/addrobj.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:
58
58
        inet_addrobj_t *addr = calloc(1, sizeof(inet_addrobj_t));
59
59
 
60
60
        if (addr == NULL) {
61
 
                log_msg(LVL_ERROR, "Failed allocating address object. "
 
61
                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed allocating address object. "
62
62
                    "Out of memory.");
63
63
                return NULL;
64
64
        }
113
113
{
114
114
        uint32_t mask;
115
115
 
116
 
        log_msg(LVL_DEBUG, "inet_addrobj_find(%x)", (unsigned)addr->ipv4);
 
116
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find(%x)", (unsigned)addr->ipv4);
117
117
 
118
118
        fibril_mutex_lock(&addr_list_lock);
119
119
 
124
124
                mask = inet_netmask(naddr->naddr.bits);
125
125
                if ((naddr->naddr.ipv4 & mask) == (addr->ipv4 & mask)) {
126
126
                        fibril_mutex_unlock(&addr_list_lock);
127
 
                        log_msg(LVL_DEBUG, "inet_addrobj_find: found %p",
 
127
                        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find: found %p",
128
128
                            naddr);
129
129
                        return naddr;
130
130
                }
131
131
        }
132
132
 
133
 
        log_msg(LVL_DEBUG, "inet_addrobj_find: Not found");
 
133
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find: Not found");
134
134
        fibril_mutex_unlock(&addr_list_lock);
135
135
 
136
136
        return NULL;
146
146
{
147
147
        assert(fibril_mutex_is_locked(&addr_list_lock));
148
148
 
149
 
        log_msg(LVL_DEBUG, "inet_addrobj_find_by_name_locked('%s', '%s')",
 
149
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find_by_name_locked('%s', '%s')",
150
150
            name, ilink->svc_name);
151
151
 
152
152
        list_foreach(addr_list, link) {
154
154
                    inet_addrobj_t, addr_list);
155
155
 
156
156
                if (naddr->ilink == ilink && str_cmp(naddr->name, name) == 0) {
157
 
                        log_msg(LVL_DEBUG, "inet_addrobj_find_by_name_locked: found %p",
 
157
                        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find_by_name_locked: found %p",
158
158
                            naddr);
159
159
                        return naddr;
160
160
                }
161
161
        }
162
162
 
163
 
        log_msg(LVL_DEBUG, "inet_addrobj_find_by_name_locked: Not found");
 
163
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find_by_name_locked: Not found");
164
164
 
165
165
        return NULL;
166
166
}
176
176
{
177
177
        inet_addrobj_t *aobj;
178
178
 
179
 
        log_msg(LVL_DEBUG, "inet_addrobj_find_by_name('%s', '%s')",
 
179
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_find_by_name('%s', '%s')",
180
180
            name, ilink->svc_name);
181
181
 
182
182
        fibril_mutex_lock(&addr_list_lock);
193
193
 */
194
194
inet_addrobj_t *inet_addrobj_get_by_id(sysarg_t id)
195
195
{
196
 
        log_msg(LVL_DEBUG, "inet_addrobj_get_by_id(%zu)", (size_t)id);
 
196
        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_addrobj_get_by_id(%zu)", (size_t)id);
197
197
 
198
198
        fibril_mutex_lock(&addr_list_lock);
199
199