Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/ucall.c

    r69a93df7 ra2e3ee6  
    7070        tcp_conn_t *nconn;
    7171
    72         log_msg(LVL_DEBUG, "tcp_uc_open(%p, %p, %s, %s, %p)",
     72        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open(%p, %p, %s, %s, %p)",
    7373            lsock, fsock, acpass == ap_active ? "active" : "passive",
    7474            oflags == tcp_open_nonblock ? "nonblock" : "none", conn);
     
    8888
    8989        /* Wait for connection to be established or reset */
    90         log_msg(LVL_DEBUG, "tcp_uc_open: Wait for connection.");
     90        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Wait for connection.");
    9191        fibril_mutex_lock(&nconn->lock);
    9292        while (nconn->cstate == st_listen ||
     
    9797
    9898        if (nconn->cstate != st_established) {
    99                 log_msg(LVL_DEBUG, "tcp_uc_open: Connection was reset.");
     99                log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Connection was reset.");
    100100                assert(nconn->cstate == st_closed);
    101101                fibril_mutex_unlock(&nconn->lock);
     
    104104
    105105        fibril_mutex_unlock(&nconn->lock);
    106         log_msg(LVL_DEBUG, "tcp_uc_open: Connection was established.");
     106        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Connection was established.");
    107107
    108108        *conn = nconn;
    109         log_msg(LVL_DEBUG, "tcp_uc_open -> %p", nconn);
     109        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open -> %p", nconn);
    110110        return TCP_EOK;
    111111}
     
    118118        size_t xfer_size;
    119119
    120         log_msg(LVL_DEBUG, "%s: tcp_uc_send()", conn->name);
     120        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_send()", conn->name);
    121121
    122122        fibril_mutex_lock(&conn->lock);
     
    141141                buf_free = conn->snd_buf_size - conn->snd_buf_used;
    142142                while (buf_free == 0 && !conn->reset) {
    143                         log_msg(LVL_DEBUG, "%s: buf_free == 0, waiting.",
     143                        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: buf_free == 0, waiting.",
    144144                            conn->name);
    145145                        fibril_condvar_wait(&conn->snd_buf_cv, &conn->lock);
     
    175175        size_t xfer_size;
    176176
    177         log_msg(LVL_DEBUG, "%s: tcp_uc_receive()", conn->name);
     177        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_receive()", conn->name);
    178178
    179179        fibril_mutex_lock(&conn->lock);
     
    186186        /* Wait for data to become available */
    187187        while (conn->rcv_buf_used == 0 && !conn->rcv_buf_fin && !conn->reset) {
    188                 log_msg(LVL_DEBUG, "tcp_uc_receive() - wait for data");
     188                log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_receive() - wait for data");
    189189                fibril_condvar_wait(&conn->rcv_buf_cv, &conn->lock);
    190190        }
     
    223223        tcp_tqueue_ctrl_seg(conn, CTL_ACK);
    224224
    225         log_msg(LVL_DEBUG, "%s: tcp_uc_receive() - returning %zu bytes",
     225        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_receive() - returning %zu bytes",
    226226            conn->name, xfer_size);
    227227
     
    234234tcp_error_t tcp_uc_close(tcp_conn_t *conn)
    235235{
    236         log_msg(LVL_DEBUG, "%s: tcp_uc_close()", conn->name);
     236        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_close()", conn->name);
    237237
    238238        fibril_mutex_lock(&conn->lock);
     
    258258void tcp_uc_abort(tcp_conn_t *conn)
    259259{
    260         log_msg(LVL_DEBUG, "tcp_uc_abort()");
     260        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_abort()");
    261261}
    262262
     
    264264void tcp_uc_status(tcp_conn_t *conn, tcp_conn_status_t *cstatus)
    265265{
    266         log_msg(LVL_DEBUG, "tcp_uc_status()");
     266        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_status()");
    267267        cstatus->cstate = conn->cstate;
    268268}
     
    276276void tcp_uc_delete(tcp_conn_t *conn)
    277277{
    278         log_msg(LVL_DEBUG, "tcp_uc_delete()");
     278        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_delete()");
    279279        tcp_conn_delete(conn);
    280280}
     
    282282void tcp_uc_set_cstate_cb(tcp_conn_t *conn, tcp_cstate_cb_t cb, void *arg)
    283283{
    284         log_msg(LVL_DEBUG, "tcp_uc_set_ctate_cb(%p, %p, %p)",
     284        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_set_ctate_cb(%p, %p, %p)",
    285285            conn, cb, arg);
    286286
     
    298298        tcp_conn_t *conn;
    299299
    300         log_msg(LVL_DEBUG, "tcp_as_segment_arrived(f:(%x,%u), l:(%x,%u))",
    301             sp->foreign.addr.ipv4, sp->foreign.port,
    302             sp->local.addr.ipv4, sp->local.port);
    303 
    304300        conn = tcp_conn_find_ref(sp);
    305301        if (conn == NULL) {
    306                 log_msg(LVL_WARN, "No connection found.");
     302                log_msg(LOG_DEFAULT, LVL_WARN, "No connection found.");
    307303                tcp_unexpected_segment(sp, seg);
    308304                return;
     
    312308
    313309        if (conn->cstate == st_closed) {
    314                 log_msg(LVL_WARN, "Connection is closed.");
     310                log_msg(LOG_DEFAULT, LVL_WARN, "Connection is closed.");
    315311                tcp_unexpected_segment(sp, seg);
    316312                fibril_mutex_unlock(&conn->lock);
     
    319315        }
    320316
    321         if (conn->ident.foreign.addr.ipv4 == TCP_IPV4_ANY)
    322                 conn->ident.foreign.addr.ipv4 = sp->foreign.addr.ipv4;
     317        if (inet_addr_is_any(&conn->ident.foreign.addr))
     318                conn->ident.foreign.addr = sp->foreign.addr;
     319       
    323320        if (conn->ident.foreign.port == TCP_PORT_ANY)
    324321                conn->ident.foreign.port = sp->foreign.port;
    325         if (conn->ident.local.addr.ipv4 == TCP_IPV4_ANY)
    326                 conn->ident.local.addr.ipv4 = sp->local.addr.ipv4;
     322       
     323        if (inet_addr_is_any(&conn->ident.local.addr))
     324                conn->ident.local.addr = sp->local.addr;
    327325
    328326        tcp_conn_segment_arrived(conn, seg);
     
    339337void tcp_to_user(void)
    340338{
    341         log_msg(LVL_DEBUG, "tcp_to_user()");
     339        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_to_user()");
    342340}
    343341
Note: See TracChangeset for help on using the changeset viewer.