static void veth_rx(void) { struct pkbuf *pkb = alloc_netdev_pkb(veth); if (veth_recv(pkb) > 0) net_in(veth, pkb); /* pass to upper */ else free_pkb(pkb); }
int CNetComm::net_io(const char* sndbuf, int sndlen, char* rcvbuf, int rcvlen) { if (safe_net_out(sndbuf, sndlen) != sndlen) { return -1; } return net_in(rcvbuf, rcvlen); }