Beispiel #1
0
ssize_t recv(int s, void *buf, size_t count, int flags)
{
    static int (*libc_recv)(int s, void *buf, size_t count, int flags);

    hook(recv);

    if (pending_frames(s))
        push_pending_frames(s, recv);

    return libc_recv(s, buf, count, flags);
}
Beispiel #2
0
ssize_t recv (int fd, void *buf, size_t n, int flags)
{
    struct simptcp_socket* sock;

#if __DEBUG__
    printf("function %s called\n", __func__);
#endif

    if (!is_simptcp_descriptor(fd)) {
        return libc_recv(fd, buf, n, flags);
    }

    /* Here comes the code for the recv related to simptcp */
    

    sock=simptcp_entity.simptcp_socket_descriptors[fd];
    return sock->socket_state->recv(sock,buf,n,flags);
}