Public Member Functions | Private Member Functions | Private Attributes | List of all members
ares::test::MockServer Class Reference

#include <ares-test.h>

Public Member Functions

std::set< intfds () const
 
 MOCK_METHOD2 (OnRequest, void(const std::string &name, int rrtype))
 
 MockServer (int family, int port)
 
void ProcessFD (int fd)
 
void SetReply (const DNSPacket *reply)
 
void SetReplyData (const std::vector< byte > &reply)
 
void SetReplyQID (int qid)
 
int tcpport () const
 
int udpport () const
 
 ~MockServer ()
 

Private Member Functions

void ProcessRequest (int fd, struct sockaddr_storage *addr, int addrlen, int qid, const std::string &name, int rrtype)
 

Private Attributes

std::set< intconnfds_
 
int qid_
 
std::vector< bytereply_
 
int tcpfd_
 
int tcpport_
 
int udpfd_
 
int udpport_
 

Detailed Description

Definition at line 137 of file ares-test.h.

Constructor & Destructor Documentation

◆ MockServer()

ares::test::MockServer::MockServer ( int  family,
int  port 
)

Definition at line 175 of file ares-test.cc.

◆ ~MockServer()

ares::test::MockServer::~MockServer ( )

Definition at line 257 of file ares-test.cc.

Member Function Documentation

◆ fds()

std::set< int > ares::test::MockServer::fds ( ) const

Definition at line 364 of file ares-test.cc.

◆ MOCK_METHOD2()

ares::test::MockServer::MOCK_METHOD2 ( OnRequest  ,
void(const std::string &name, int rrtype)   
)

◆ ProcessFD()

void ares::test::MockServer::ProcessFD ( int  fd)

Definition at line 265 of file ares-test.cc.

◆ ProcessRequest()

void ares::test::MockServer::ProcessRequest ( int  fd,
struct sockaddr_storage *  addr,
int  addrlen,
int  qid,
const std::string &  name,
int  rrtype 
)
private

Definition at line 371 of file ares-test.cc.

◆ SetReply()

void ares::test::MockServer::SetReply ( const DNSPacket reply)
inline

Definition at line 149 of file ares-test.h.

◆ SetReplyData()

void ares::test::MockServer::SetReplyData ( const std::vector< byte > &  reply)
inline

Definition at line 148 of file ares-test.h.

◆ SetReplyQID()

void ares::test::MockServer::SetReplyQID ( int  qid)
inline

Definition at line 150 of file ares-test.h.

◆ tcpport()

int ares::test::MockServer::tcpport ( ) const
inline

Definition at line 160 of file ares-test.h.

◆ udpport()

int ares::test::MockServer::udpport ( ) const
inline

Definition at line 159 of file ares-test.h.

Member Data Documentation

◆ connfds_

std::set<int> ares::test::MockServer::connfds_
private

Definition at line 170 of file ares-test.h.

◆ qid_

int ares::test::MockServer::qid_
private

Definition at line 172 of file ares-test.h.

◆ reply_

std::vector<byte> ares::test::MockServer::reply_
private

Definition at line 171 of file ares-test.h.

◆ tcpfd_

int ares::test::MockServer::tcpfd_
private

Definition at line 169 of file ares-test.h.

◆ tcpport_

int ares::test::MockServer::tcpport_
private

Definition at line 167 of file ares-test.h.

◆ udpfd_

int ares::test::MockServer::udpfd_
private

Definition at line 168 of file ares-test.h.

◆ udpport_

int ares::test::MockServer::udpport_
private

Definition at line 166 of file ares-test.h.


The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:02:57