stub_comm.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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 */
25 #include "base/DelayedAsyncCalls.h"
28 
29 #include "comm.h"
30 bool comm_iocallbackpending(void) STUB_RETVAL(false)
34 void _comm_close(int, char const *, int) STUB
35 void old_comm_reset_close(int) STUB
37 int comm_connect_addr(int, const Ip::Address &) STUB_RETVAL(-1)
38 
39 void comm_init(void) STUB
40 void comm_exit(void) STUB
41 int comm_open(int, int, Ip::Address &, int, const char *) STUB_RETVAL(-1)
42 int comm_open_uds(int, int, struct sockaddr_un*, int) STUB_RETVAL(-1)
43 void comm_import_opened(const Comm::ConnectionPointer &, const char *, struct addrinfo *) STUB
44 int comm_open_listener(int, int, Ip::Address &, int, const char *) STUB_RETVAL(-1)
45 void comm_open_listener(int, int, Comm::ConnectionPointer &, const char *) STUB
46 unsigned short comm_local_port(int) STUB_RETVAL(0)
47 int comm_udp_sendto(int, const Ip::Address &, const void *, int) STUB_RETVAL(-1)
49 void commUnsetFdTimeout(int) STUB
50 // int commSetTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer&) STUB_RETVAL(-1)
51 void commSetConnTimeout(const Comm::ConnectionPointer &, time_t, AsyncCall::Pointer &) STUB
53 int ignoreErrno(int) STUB_RETVAL(-1)
54 void commCloseAllSockets(void) STUB
55 void checkTimeouts(void) STUB
56 AsyncCall::Pointer comm_add_close_handler(int, CLCB *, void *) STUB
57 void comm_add_close_handler(int, AsyncCall::Pointer &) STUB
58 void comm_remove_close_handler(int, CLCB *, void *) STUB
59 void comm_remove_close_handler(int, AsyncCall::Pointer &)STUB
60 int comm_udp_recvfrom(int, void *, size_t, int, Ip::Address &) STUB_RETVAL(-1)
61 int comm_udp_recv(int, void *, size_t, int) STUB_RETVAL(-1)
62 ssize_t comm_udp_send(int, const void *, size_t, int) STUB_RETVAL(-1)
66 int CommSelectEngine::checkEvents(int) STUB_RETVAL(0)
67 
void comm_exit(void)
Definition: comm.cc:1171
AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:952
void commUnsetConnTimeout(const Comm::ConnectionPointer &conn)
Definition: comm.cc:616
void _comm_close(int fd, char const *file, int line)
Definition: comm.cc:849
void commSetCloseOnExec(int)
Definition: minimal.cc:27
#define STUB_RETVAL(x)
Definition: STUB.h:42
int comm_connect_addr(int sock, const Ip::Address &address)
Definition: comm.cc:629
int comm_udp_sendto(int fd, const Ip::Address &to_addr, const void *buf, int len)
Definition: comm.cc:921
void commCallCloseHandlers(int fd)
Definition: comm.cc:754
void delay(const AsyncCallPointer &)
stores the given call to schedule it at schedule() or destruction time
ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags)
Definition: comm.cc:146
int comm_udp_recv(int fd, void *buf, size_t len, int flags)
Definition: comm.cc:139
int commSetNonBlocking(int fd)
Definition: comm.cc:1054
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition: AcceptLimiter.h:16
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:549
void CLCB(const CommCloseCbParams &params)
Definition: CommCalls.h:40
bool commHasHalfClosedMonitor(int fd)
checks whether we are waiting for possibly half-closed connection to close
Definition: comm.cc:1612
bool comm_has_incomplete_write(int fd)
Definition: comm.cc:152
void commCloseAllSockets(void)
Definition: comm.cc:1452
bool comm_iocallbackpending(void)
void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note)
Definition: comm.cc:257
int commUnsetNonBlocking(int fd)
Definition: comm.cc:1087
void comm_init(void)
Definition: comm.cc:1151
void commUnsetFdTimeout(int fd)
clear a timeout handler by FD number
Definition: comm.cc:579
void checkTimeouts(void)
Definition: comm.cc:1509
unsigned short comm_local_port(int fd)
Definition: comm.cc:165
void comm_reset_close(const Comm::ConnectionPointer &conn)
Definition: comm.cc:797
void schedule()
schedules and forgets all async calls previously stored by delay()
@ COMM_ERROR
Definition: Flag.h:17
int comm_open(int sock_type, int proto, Ip::Address &addr, int flags, const char *note)
Definition: comm.cc:243
#define STUB
macro to stub a void function.
Definition: STUB.h:34
Definition: Xaction.cc:137
int ignoreErrno(int ierrno)
Definition: comm.cc:1422
RefCount< Comm::Connection > ConnectionPointer
Definition: forward.h:26
void commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t timeout, AsyncCall::Pointer &callback)
Definition: comm.cc:592
#define STUB_NOP
Definition: STUB.h:38
int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, Ip::Address &from)
Definition: comm.cc:126
void commStartHalfClosedMonitor(int fd)
Start waiting for a possibly half-closed connection to close.
Definition: comm.cc:1562
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:1692
void old_comm_reset_close(int fd)
Definition: comm.cc:808
void comm_remove_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:981
int unsigned int
Definition: stub_fd.cc:19

 

Introduction

Documentation

Support

Miscellaneous