Changeset a1e2df13 in mainline for uspace/srv/net/udp/assoc.c
- Timestamp:
- 2012-11-11T21:31:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 25eec4ef
- Parents:
- 141a20d (diff), d1538a1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/udp/assoc.c
r141a20d ra1e2df13 104 104 static void udp_assoc_free(udp_assoc_t *assoc) 105 105 { 106 log_msg(L VL_DEBUG, "%s: udp_assoc_free(%p)", assoc->name, assoc);106 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: udp_assoc_free(%p)", assoc->name, assoc); 107 107 108 108 while (!list_empty(&assoc->rcv_queue)) { … … 127 127 void udp_assoc_addref(udp_assoc_t *assoc) 128 128 { 129 log_msg(L VL_DEBUG, "%s: upd_assoc_addref(%p)", assoc->name, assoc);129 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: upd_assoc_addref(%p)", assoc->name, assoc); 130 130 atomic_inc(&assoc->refcnt); 131 131 } … … 139 139 void udp_assoc_delref(udp_assoc_t *assoc) 140 140 { 141 log_msg(L VL_DEBUG, "%s: udp_assoc_delref(%p)", assoc->name, assoc);141 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: udp_assoc_delref(%p)", assoc->name, assoc); 142 142 143 143 if (atomic_predec(&assoc->refcnt) == 0) … … 154 154 void udp_assoc_delete(udp_assoc_t *assoc) 155 155 { 156 log_msg(L VL_DEBUG, "%s: udp_assoc_delete(%p)", assoc->name, assoc);156 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: udp_assoc_delete(%p)", assoc->name, assoc); 157 157 158 158 assert(assoc->deleted == false); … … 192 192 void udp_assoc_set_foreign(udp_assoc_t *assoc, udp_sock_t *fsock) 193 193 { 194 log_msg(L VL_DEBUG, "udp_assoc_set_foreign(%p, %p)", assoc, fsock);194 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_set_foreign(%p, %p)", assoc, fsock); 195 195 fibril_mutex_lock(&assoc->lock); 196 196 assoc->ident.foreign = *fsock; … … 205 205 void udp_assoc_set_local(udp_assoc_t *assoc, udp_sock_t *lsock) 206 206 { 207 log_msg(L VL_DEBUG, "udp_assoc_set_local(%p, %p)", assoc, lsock);207 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_set_local(%p, %p)", assoc, lsock); 208 208 fibril_mutex_lock(&assoc->lock); 209 209 assoc->ident.local = *lsock; … … 228 228 int rc; 229 229 230 log_msg(L VL_DEBUG, "udp_assoc_send(%p, %p, %p)",230 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_send(%p, %p, %p)", 231 231 assoc, fsock, msg); 232 232 … … 261 261 udp_rcv_queue_entry_t *rqe; 262 262 263 log_msg(L VL_DEBUG, "udp_assoc_recv()");263 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv()"); 264 264 265 265 fibril_mutex_lock(&assoc->lock); 266 266 while (list_empty(&assoc->rcv_queue) && !assoc->reset) { 267 log_msg(L VL_DEBUG, "udp_assoc_recv() - waiting");267 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - waiting"); 268 268 fibril_condvar_wait(&assoc->rcv_queue_cv, &assoc->lock); 269 269 } 270 270 271 271 if (assoc->reset) { 272 log_msg(L VL_DEBUG, "udp_assoc_recv() - association was reset");272 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - association was reset"); 273 273 fibril_mutex_unlock(&assoc->lock); 274 274 return ECONNABORTED; 275 275 } 276 276 277 log_msg(L VL_DEBUG, "udp_assoc_recv() - got a message");277 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - got a message"); 278 278 link = list_first(&assoc->rcv_queue); 279 279 rqe = list_get_instance(link, udp_rcv_queue_entry_t, link); … … 297 297 int rc; 298 298 299 log_msg(L VL_DEBUG, "udp_assoc_received(%p, %p)", rsp, msg);299 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_received(%p, %p)", rsp, msg); 300 300 301 301 assoc = udp_assoc_find_ref(rsp); 302 302 if (assoc == NULL) { 303 log_msg(L VL_DEBUG, "No association found. Message dropped.");303 log_msg(LOG_DEFAULT, LVL_DEBUG, "No association found. Message dropped."); 304 304 /* XXX Generate ICMP error. */ 305 305 /* XXX Might propagate error directly by error return. */ … … 309 309 rc = udp_assoc_queue_msg(assoc, rsp, msg); 310 310 if (rc != EOK) { 311 log_msg(L VL_DEBUG, "Out of memory. Message dropped.");311 log_msg(LOG_DEFAULT, LVL_DEBUG, "Out of memory. Message dropped."); 312 312 /* XXX Generate ICMP error? */ 313 313 } … … 332 332 udp_rcv_queue_entry_t *rqe; 333 333 334 log_msg(L VL_DEBUG, "udp_assoc_queue_msg(%p, %p, %p)",334 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_queue_msg(%p, %p, %p)", 335 335 assoc, sp, msg); 336 336 … … 355 355 static bool udp_socket_match(udp_sock_t *sock, udp_sock_t *patt) 356 356 { 357 log_msg(L VL_DEBUG, "udp_socket_match(sock=(%x,%u), pat=(%x,%u))",357 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_socket_match(sock=(%x,%u), pat=(%x,%u))", 358 358 sock->addr.ipv4, sock->port, patt->addr.ipv4, patt->port); 359 359 … … 366 366 return false; 367 367 368 log_msg(L VL_DEBUG, " -> match");368 log_msg(LOG_DEFAULT, LVL_DEBUG, " -> match"); 369 369 370 370 return true; … … 374 374 static bool udp_sockpair_match(udp_sockpair_t *sp, udp_sockpair_t *pattern) 375 375 { 376 log_msg(L VL_DEBUG, "udp_sockpair_match(%p, %p)", sp, pattern);376 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sockpair_match(%p, %p)", sp, pattern); 377 377 378 378 if (!udp_socket_match(&sp->local, &pattern->local)) … … 382 382 return false; 383 383 384 log_msg(L VL_DEBUG, "Socket pair matched.");384 log_msg(LOG_DEFAULT, LVL_DEBUG, "Socket pair matched."); 385 385 return true; 386 386 } … … 398 398 static udp_assoc_t *udp_assoc_find_ref(udp_sockpair_t *sp) 399 399 { 400 log_msg(L VL_DEBUG, "udp_assoc_find_ref(%p)", sp);400 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_find_ref(%p)", sp); 401 401 402 402 fibril_mutex_lock(&assoc_list_lock); … … 405 405 udp_assoc_t *assoc = list_get_instance(link, udp_assoc_t, link); 406 406 udp_sockpair_t *asp = &assoc->ident; 407 log_msg(L VL_DEBUG, "compare with assoc (f:(%x,%u), l:(%x,%u))",407 log_msg(LOG_DEFAULT, LVL_DEBUG, "compare with assoc (f:(%x,%u), l:(%x,%u))", 408 408 asp->foreign.addr.ipv4, asp->foreign.port, 409 409 asp->local.addr.ipv4, asp->local.port); … … 414 414 415 415 if (udp_sockpair_match(sp, asp)) { 416 log_msg(L VL_DEBUG, "Returning assoc %p", assoc);416 log_msg(LOG_DEFAULT, LVL_DEBUG, "Returning assoc %p", assoc); 417 417 udp_assoc_addref(assoc); 418 418 fibril_mutex_unlock(&assoc_list_lock);
Note:
See TracChangeset
for help on using the changeset viewer.