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 */
28
29#include "comm.h"
30bool comm_iocallbackpending(void) STUB_RETVAL(false)
34void _comm_close(int, char const *, int) 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)
51int commSetConnTimeout(const Comm::ConnectionPointer &, time_t, AsyncCall::Pointer &) STUB_RETVAL(-1)
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:33
#define STUB_NOP
Definition: STUB.h:37
#define STUB_RETVAL(x)
Definition: STUB.h:41
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
int commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t timeout, AsyncCall::Pointer &callback)
Definition: comm.cc:595
void commCallCloseHandlers(int fd)
Definition: comm.cc:759
int commSetNonBlocking(int fd)
Definition: comm.cc:1066
void _comm_close(int fd, char const *file, int line)
Definition: comm.cc:846
AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:949
void comm_remove_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:978
unsigned short comm_local_port(int fd)
Definition: comm.cc:164
void old_comm_reset_close(int fd)
Definition: comm.cc:800
bool comm_has_incomplete_write(int fd)
Definition: comm.cc:151
void commSetCloseOnExec(int fd)
Definition: comm.cc:1127
void commUnsetFdTimeout(int fd)
clear a timeout handler by FD number
Definition: comm.cc:582
int ignoreErrno(int ierrno)
Definition: comm.cc:1440
void comm_init(void)
Definition: comm.cc:1166
int commUnsetNonBlocking(int fd)
Definition: comm.cc:1099
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:1710
void checkTimeouts(void)
Definition: comm.cc:1527
void comm_exit(void)
Definition: comm.cc:1189
int comm_udp_sendto(int fd, const Ip::Address &to_addr, const void *buf, int len)
Definition: comm.cc:918
void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note)
Definition: comm.cc:256
bool commHasHalfClosedMonitor(int fd)
checks whether we are waiting for possibly half-closed connection to close
Definition: comm.cc:1630
void commCloseAllSockets(void)
Definition: comm.cc:1470
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:542
int comm_udp_recv(int fd, void *buf, size_t len, int flags)
Definition: comm.cc:138
int comm_open(int sock_type, int proto, Ip::Address &addr, int flags, const char *note)
Definition: comm.cc:242
int comm_connect_addr(int sock, const Ip::Address &address)
Definition: comm.cc:634
ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags)
Definition: comm.cc:145
void commStartHalfClosedMonitor(int fd)
Start waiting for a possibly half-closed connection to close.
Definition: comm.cc:1580
int commUnsetConnTimeout(const Comm::ConnectionPointer &conn)
Definition: comm.cc:621
int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, Ip::Address &from)
Definition: comm.cc:125
void comm_reset_close(const Comm::ConnectionPointer &conn)
Definition: comm.cc:785
bool comm_iocallbackpending(void)
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition: AcceptLimiter.h:17
RefCount< Comm::Connection > ConnectionPointer
Definition: forward.h:28
@ COMM_ERROR
Definition: Flag.h:17
Definition: Xaction.cc:139
int unsigned int
Definition: stub_fd.cc:19

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors