stub_comm.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2022 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 // int comm_openex(int, int, Ip::Address &, int, tos_t, nfmark_t, const char *) STUB_RETVAL(-1)
47 unsigned short comm_local_port(int) STUB_RETVAL(0)
48 int comm_udp_sendto(int, const Ip::Address &, const void *, int) STUB_RETVAL(-1)
50 void commUnsetFdTimeout(int) STUB
51 // int commSetTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer&) STUB_RETVAL(-1)
52 int commSetConnTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer &) STUB_RETVAL(-1)
54 int ignoreErrno(int) STUB_RETVAL(-1)
55 void commCloseAllSockets(void) STUB
56 void checkTimeouts(void) STUB
57 AsyncCall::Pointer comm_add_close_handler(int, CLCB *, void *) STUB
58 void comm_add_close_handler(int, AsyncCall::Pointer &) STUB
59 void comm_remove_close_handler(int, CLCB *, void *) STUB
60 void comm_remove_close_handler(int, AsyncCall::Pointer &)STUB
61 int comm_udp_recvfrom(int, void *, size_t, int, Ip::Address &) STUB_RETVAL(-1)
62 int comm_udp_recv(int, void *, size_t, int) STUB_RETVAL(-1)
63 ssize_t comm_udp_send(int, const void *, size_t, int) STUB_RETVAL(-1)
67 int CommSelectEngine::checkEvents(int) STUB_RETVAL(0)
68 
void comm_exit(void)
Definition: comm.cc:1161
AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:921
void _comm_close(int fd, char const *file, int line)
Definition: comm.cc:814
#define STUB_RETVAL(x)
Definition: STUB.h:41
int comm_connect_addr(int sock, const Ip::Address &address)
Definition: comm.cc:602
int comm_udp_sendto(int fd, const Ip::Address &to_addr, const void *buf, int len)
Definition: comm.cc:890
void commCallCloseHandlers(int fd)
Definition: comm.cc:727
void delay(const AsyncCallPointer &)
stores the given call to schedule it at schedule() or destruction time
int commSetConnTimeout(const Comm::ConnectionPointer &conn, int timeout, AsyncCall::Pointer &callback)
Definition: comm.cc:563
ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags)
Definition: comm.cc:142
int comm_udp_recv(int fd, void *buf, size_t len, int flags)
Definition: comm.cc:135
int commSetNonBlocking(int fd)
Definition: comm.cc:1038
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition: AcceptLimiter.h:17
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:510
void CLCB(const CommCloseCbParams &params)
Definition: CommCalls.h:42
bool commHasHalfClosedMonitor(int fd)
checks whether we are waiting for possibly half-closed connection to close
Definition: comm.cc:1602
bool comm_has_incomplete_write(int fd)
Definition: comm.cc:148
void commCloseAllSockets(void)
Definition: comm.cc:1442
bool comm_iocallbackpending(void)
void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note)
Definition: comm.cc:233
int commUnsetNonBlocking(int fd)
Definition: comm.cc:1071
void comm_init(void)
Definition: comm.cc:1138
void commUnsetFdTimeout(int fd)
clear a timeout handler by FD number
Definition: comm.cc:550
void checkTimeouts(void)
Definition: comm.cc:1499
unsigned short comm_local_port(int fd)
Definition: comm.cc:161
void comm_reset_close(const Comm::ConnectionPointer &conn)
Definition: comm.cc:753
void commSetCloseOnExec(int fd)
Definition: comm.cc:1099
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:223
#define STUB
macro to stub a void function.
Definition: STUB.h:33
int commUnsetConnTimeout(const Comm::ConnectionPointer &conn)
Definition: comm.cc:589
Definition: client_db.h:23
int ignoreErrno(int ierrno)
Definition: comm.cc:1412
RefCount< Comm::Connection > ConnectionPointer
Definition: forward.h:26
#define STUB_NOP
Definition: STUB.h:37
int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, Ip::Address &from)
Definition: comm.cc:122
void commStartHalfClosedMonitor(int fd)
Start waiting for a possibly half-closed connection to close.
Definition: comm.cc:1552
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:1682
#define false
Definition: GnuRegex.c:233
void old_comm_reset_close(int fd)
Definition: comm.cc:768
void comm_remove_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:950
int unsigned int
Definition: stub_fd.cc:19

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors