Squashed 'external/toxcore/c-toxcore/' changes from 1828c5356..c9cdae001
c9cdae001 fix(toxav): remove extra copy of video frame on encode 4f6d4546b test: Improve the fake network library. a2581e700 refactor(toxcore): generate `Friend_Request` and `Dht_Nodes_Response` 2aaa11770 refactor(toxcore): use Tox_Memory in generated events 5c367452b test(toxcore): fix incorrect mutex in tox_scenario_get_time 8f92e710f perf: Add a timed limit of number of cookie requests. 695b6417a test: Add some more simulated network support. 815ae9ce9 test(toxcore): fix thread-safety in scenario framework 6d85c754e test(toxcore): add unit tests for net_crypto 9c22e79cc test(support): add SimulatedEnvironment for deterministic testing f34fcb195 chore: Update windows Dockerfile to debian stable (trixie). ece0e8980 fix(group_moderation): allow validating unsorted sanction list signatures a4fa754d7 refactor: rename struct Packet to struct Net_Packet d6f330f85 cleanup: Fix some warnings from coverity. e206bffa2 fix(group_chats): fix sync packets reverting topics 0e4715598 test: Add new scenario testing framework. 668291f44 refactor(toxcore): decouple Network_Funcs from sockaddr via IP_Port fc4396cef fix: potential division by zero in toxav and unsafe hex parsing 8e8b352ab refactor: Add nullable annotations to struct members. 7740bb421 refactor: decouple net_crypto from DHT 1936d4296 test: add benchmark for toxav audio and video 46bfdc2df fix: correct printf format specifiers for unsigned integers REVERT: 1828c5356 fix(toxav): remove extra copy of video frame on encode git-subtree-dir: external/toxcore/c-toxcore git-subtree-split: c9cdae001341e701fca980c9bb9febfeb95d2902
This commit is contained in:
@@ -7,87 +7,6 @@
|
||||
#include "network.h"
|
||||
#include "test_util.hh"
|
||||
|
||||
Network_Funcs const Network_Class::vtable = {
|
||||
Method<net_close_cb, Network_Class>::invoke<&Network_Class::close>,
|
||||
Method<net_accept_cb, Network_Class>::invoke<&Network_Class::accept>,
|
||||
Method<net_bind_cb, Network_Class>::invoke<&Network_Class::bind>,
|
||||
Method<net_listen_cb, Network_Class>::invoke<&Network_Class::listen>,
|
||||
Method<net_connect_cb, Network_Class>::invoke<&Network_Class::connect>,
|
||||
Method<net_recvbuf_cb, Network_Class>::invoke<&Network_Class::recvbuf>,
|
||||
Method<net_recv_cb, Network_Class>::invoke<&Network_Class::recv>,
|
||||
Method<net_recvfrom_cb, Network_Class>::invoke<&Network_Class::recvfrom>,
|
||||
Method<net_send_cb, Network_Class>::invoke<&Network_Class::send>,
|
||||
Method<net_sendto_cb, Network_Class>::invoke<&Network_Class::sendto>,
|
||||
Method<net_socket_cb, Network_Class>::invoke<&Network_Class::socket>,
|
||||
Method<net_socket_nonblock_cb, Network_Class>::invoke<&Network_Class::socket_nonblock>,
|
||||
Method<net_getsockopt_cb, Network_Class>::invoke<&Network_Class::getsockopt>,
|
||||
Method<net_setsockopt_cb, Network_Class>::invoke<&Network_Class::setsockopt>,
|
||||
Method<net_getaddrinfo_cb, Network_Class>::invoke<&Network_Class::getaddrinfo>,
|
||||
Method<net_freeaddrinfo_cb, Network_Class>::invoke<&Network_Class::freeaddrinfo>,
|
||||
};
|
||||
|
||||
int Test_Network::close(void *obj, Socket sock) { return net->funcs->close(net->obj, sock); }
|
||||
Socket Test_Network::accept(void *obj, Socket sock) { return net->funcs->accept(net->obj, sock); }
|
||||
int Test_Network::bind(void *obj, Socket sock, const Network_Addr *addr)
|
||||
{
|
||||
return net->funcs->bind(net->obj, sock, addr);
|
||||
}
|
||||
int Test_Network::listen(void *obj, Socket sock, int backlog)
|
||||
{
|
||||
return net->funcs->listen(net->obj, sock, backlog);
|
||||
}
|
||||
int Test_Network::connect(void *obj, Socket sock, const Network_Addr *addr)
|
||||
{
|
||||
return net->funcs->connect(net->obj, sock, addr);
|
||||
}
|
||||
int Test_Network::recvbuf(void *obj, Socket sock) { return net->funcs->recvbuf(net->obj, sock); }
|
||||
int Test_Network::recv(void *obj, Socket sock, uint8_t *buf, size_t len)
|
||||
{
|
||||
return net->funcs->recv(net->obj, sock, buf, len);
|
||||
}
|
||||
int Test_Network::recvfrom(void *obj, Socket sock, uint8_t *buf, size_t len, Network_Addr *addr)
|
||||
{
|
||||
return net->funcs->recvfrom(net->obj, sock, buf, len, addr);
|
||||
}
|
||||
int Test_Network::send(void *obj, Socket sock, const uint8_t *buf, size_t len)
|
||||
{
|
||||
return net->funcs->send(net->obj, sock, buf, len);
|
||||
}
|
||||
int Test_Network::sendto(
|
||||
void *obj, Socket sock, const uint8_t *buf, size_t len, const Network_Addr *addr)
|
||||
{
|
||||
return net->funcs->sendto(net->obj, sock, buf, len, addr);
|
||||
}
|
||||
Socket Test_Network::socket(void *obj, int domain, int type, int proto)
|
||||
{
|
||||
return net->funcs->socket(net->obj, domain, type, proto);
|
||||
}
|
||||
int Test_Network::socket_nonblock(void *obj, Socket sock, bool nonblock)
|
||||
{
|
||||
return net->funcs->socket_nonblock(net->obj, sock, nonblock);
|
||||
}
|
||||
int Test_Network::getsockopt(
|
||||
void *obj, Socket sock, int level, int optname, void *optval, size_t *optlen)
|
||||
{
|
||||
return net->funcs->getsockopt(net->obj, sock, level, optname, optval, optlen);
|
||||
}
|
||||
int Test_Network::setsockopt(
|
||||
void *obj, Socket sock, int level, int optname, const void *optval, size_t optlen)
|
||||
{
|
||||
return net->funcs->setsockopt(net->obj, sock, level, optname, optval, optlen);
|
||||
}
|
||||
int Test_Network::getaddrinfo(void *obj, const Memory *mem, const char *address, int family,
|
||||
int protocol, Network_Addr **addrs)
|
||||
{
|
||||
return net->funcs->getaddrinfo(net->obj, mem, address, family, protocol, addrs);
|
||||
}
|
||||
int Test_Network::freeaddrinfo(void *obj, const Memory *mem, Network_Addr *addrs)
|
||||
{
|
||||
return net->funcs->freeaddrinfo(net->obj, mem, addrs);
|
||||
}
|
||||
|
||||
Network_Class::~Network_Class() = default;
|
||||
|
||||
IP_Port increasing_ip_port::operator()()
|
||||
{
|
||||
IP_Port ip_port;
|
||||
|
||||
Reference in New Issue
Block a user