Squid Web Cache master
Loading...
Searching...
No Matches
stub_comm.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#include "squid.h"
10#include "comm.h"
11#include "comm/Connection.h"
12#include "comm/Loops.h"
13// #include "comm/Read.h"
14#include "fde.h"
15
16#define STUB_API "comm.cc"
17#include "tests/STUB.h"
18
19#include <ostream>
20
21// void comm_read(const Comm::ConnectionPointer &, char *, int, IOCB *, void *) STUB
22// void comm_read(const Comm::ConnectionPointer &, char*, int, AsyncCall::Pointer &) STUB
23
24/* should be in stub_libbase */
28
29#include "comm.h"
30bool comm_iocallbackpending(void) STUB_RETVAL(false)
31int commSetNonBlocking(int) STUB_RETVAL(Comm::COMM_ERROR)
34void _comm_close(int, char const *, int) STUB
36void comm_reset_close(const Comm::ConnectionPointer &) STUB
37int comm_connect_addr(int, const Ip::Address &) STUB_RETVAL(-1)
38
39void comm_init(void) STUB
40void comm_exit(void) STUB
41int comm_open(int, int, Ip::Address &, int, const char *) STUB_RETVAL(-1)
42int comm_open_uds(int, int, struct sockaddr_un*, int) STUB_RETVAL(-1)
43void comm_import_opened(const Comm::ConnectionPointer &, const char *, struct addrinfo *) STUB
44int comm_open_listener(int, int, Ip::Address &, int, const char *) STUB_RETVAL(-1)
45void comm_open_listener(int, int, Comm::ConnectionPointer &, const char *) STUB
46unsigned short comm_local_port(int) STUB_RETVAL(0)
47int comm_udp_sendto(int, const Ip::Address &, const void *, int) STUB_RETVAL(-1)
50// int commSetTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer&) STUB_RETVAL(-1)
51void commSetConnTimeout(const Comm::ConnectionPointer &, time_t, AsyncCall::Pointer &) STUB
52void commUnsetConnTimeout(const Comm::ConnectionPointer &) STUB
53int ignoreErrno(int) STUB_RETVAL(-1)
55void checkTimeouts(void) STUB
56AsyncCall::Pointer comm_add_close_handler(int, CLCB *, void *) STUB
57void comm_add_close_handler(int, AsyncCall::Pointer &) STUB
58void comm_remove_close_handler(int, CLCB *, void *) STUB
59void comm_remove_close_handler(int, AsyncCall::Pointer &)STUB
60int comm_udp_recvfrom(int, void *, size_t, int, Ip::Address &) STUB_RETVAL(-1)
61int comm_udp_recv(int, void *, size_t, int) STUB_RETVAL(-1)
62ssize_t comm_udp_send(int, const void *, size_t, int) STUB_RETVAL(-1)
66int CommSelectEngine::checkEvents(int) STUB_RETVAL(0)
67
void CLCB(const CommCloseCbParams &params)
Definition CommCalls.h:40
#define STUB
macro to stub a void function.
Definition STUB.h:34
#define STUB_NOP
Definition STUB.h:38
#define STUB_RETVAL(x)
Definition STUB.h:42
void schedule()
schedules and forgets all async calls previously stored by delay()
void delay(const AsyncCallPointer &)
stores the given call to schedule it at schedule() or destruction time
void commCallCloseHandlers(int fd)
Definition comm.cc:744
void commUnsetConnTimeout(const Comm::ConnectionPointer &conn)
Definition comm.cc:618
int commSetNonBlocking(int fd)
Definition comm.cc:1044
void _comm_close(int fd, char const *file, int line)
Definition comm.cc:839
AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *handler, void *data)
Definition comm.cc:942
void comm_remove_close_handler(int fd, CLCB *handler, void *data)
Definition comm.cc:971
unsigned short comm_local_port(int fd)
Definition comm.cc:167
void commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t timeout, AsyncCall::Pointer &callback)
Definition comm.cc:594
void old_comm_reset_close(int fd)
Definition comm.cc:798
bool comm_has_incomplete_write(int fd)
Definition comm.cc:154
void commSetCloseOnExec(int fd)
Definition comm.cc:1105
void commUnsetFdTimeout(int fd)
clear a timeout handler by FD number
Definition comm.cc:581
int ignoreErrno(int ierrno)
Definition comm.cc:1407
void comm_init(void)
Definition comm.cc:1141
int commUnsetNonBlocking(int fd)
Definition comm.cc:1077
int comm_open_uds(int sock_type, int proto, struct sockaddr_un *addr, int flags)
Create a unix-domain socket (UDS) that only supports FD_MSGHDR I/O.
Definition comm.cc:1677
void checkTimeouts(void)
Definition comm.cc:1494
void comm_exit(void)
Definition comm.cc:1158
int comm_udp_sendto(int fd, const Ip::Address &to_addr, const void *buf, int len)
Definition comm.cc:911
void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note)
Definition comm.cc:259
bool commHasHalfClosedMonitor(int fd)
checks whether we are waiting for possibly half-closed connection to close
Definition comm.cc:1597
void commCloseAllSockets(void)
Definition comm.cc:1437
void comm_import_opened(const Comm::ConnectionPointer &conn, const char *note, struct addrinfo *AI)
update Comm state after getting a comm_open() FD from another process
Definition comm.cc:551
int comm_udp_recv(int fd, void *buf, size_t len, int flags)
Definition comm.cc:141
int comm_open(int sock_type, int proto, Ip::Address &addr, int flags, const char *note)
Definition comm.cc:245
int comm_connect_addr(int sock, const Ip::Address &address)
Definition comm.cc:631
ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags)
Definition comm.cc:148
void commStartHalfClosedMonitor(int fd)
Start waiting for a possibly half-closed connection to close.
Definition comm.cc:1547
int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, Ip::Address &from)
Definition comm.cc:128
void comm_reset_close(const Comm::ConnectionPointer &conn)
Definition comm.cc:787
bool comm_iocallbackpending(void)
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition Xaction.cc:137
int unsigned int
Definition stub_fd.cc:19