Ignore:
File:
1 edited

Legend:

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

    ra2e3ee6 r69a93df7  
    7070        tcp_conn_t *nconn;
    7171
    72         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open(%p, %p, %s, %s, %p)",
     72        log_msg(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(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Wait for connection.");
     90        log_msg(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(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Connection was reset.");
     99                log_msg(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(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Connection was established.");
     106        log_msg(LVL_DEBUG, "tcp_uc_open: Connection was established.");
    107107
    108108        *conn = nconn;
    109         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open -> %p", nconn);
     109        log_msg(LVL_DEBUG, "tcp_uc_open -> %p", nconn);
    110110        return TCP_EOK;
    111111}
     
    118118        size_t xfer_size;
    119119
    120         log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_send()", conn->name);
     120        log_msg(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(LOG_DEFAULT, LVL_DEBUG, "%s: buf_free == 0, waiting.",
     143                        log_msg(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(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_receive()", conn->name);
     177        log_msg(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(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_receive() - wait for data");
     188                log_msg(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(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_receive() - returning %zu bytes",
     225        log_msg(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(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_close()", conn->name);
     236        log_msg(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(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_abort()");
     260        log_msg(LVL_DEBUG, "tcp_uc_abort()");
    261261}
    262262
     
    264264void tcp_uc_status(tcp_conn_t *conn, tcp_conn_status_t *cstatus)
    265265{
    266         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_status()");
     266        log_msg(LVL_DEBUG, "tcp_uc_status()");
    267267        cstatus->cstate = conn->cstate;
    268268}
     
    276276void tcp_uc_delete(tcp_conn_t *conn)
    277277{
    278         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_delete()");
     278        log_msg(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(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_set_ctate_cb(%p, %p, %p)",
     284        log_msg(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
    300304        conn = tcp_conn_find_ref(sp);
    301305        if (conn == NULL) {
    302                 log_msg(LOG_DEFAULT, LVL_WARN, "No connection found.");
     306                log_msg(LVL_WARN, "No connection found.");
    303307                tcp_unexpected_segment(sp, seg);
    304308                return;
     
    308312
    309313        if (conn->cstate == st_closed) {
    310                 log_msg(LOG_DEFAULT, LVL_WARN, "Connection is closed.");
     314                log_msg(LVL_WARN, "Connection is closed.");
    311315                tcp_unexpected_segment(sp, seg);
    312316                fibril_mutex_unlock(&conn->lock);
     
    315319        }
    316320
    317         if (inet_addr_is_any(&conn->ident.foreign.addr))
    318                 conn->ident.foreign.addr = sp->foreign.addr;
    319        
     321        if (conn->ident.foreign.addr.ipv4 == TCP_IPV4_ANY)
     322                conn->ident.foreign.addr.ipv4 = sp->foreign.addr.ipv4;
    320323        if (conn->ident.foreign.port == TCP_PORT_ANY)
    321324                conn->ident.foreign.port = sp->foreign.port;
    322        
    323         if (inet_addr_is_any(&conn->ident.local.addr))
    324                 conn->ident.local.addr = sp->local.addr;
     325        if (conn->ident.local.addr.ipv4 == TCP_IPV4_ANY)
     326                conn->ident.local.addr.ipv4 = sp->local.addr.ipv4;
    325327
    326328        tcp_conn_segment_arrived(conn, seg);
     
    337339void tcp_to_user(void)
    338340{
    339         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_to_user()");
     341        log_msg(LVL_DEBUG, "tcp_to_user()");
    340342}
    341343
Note: See TracChangeset for help on using the changeset viewer.