gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::ListenSocket Class Referenceabstract

#include <socket.hh>

Inheritance diagram for gem5::ListenSocket:
gem5::Named gem5::ListenSocketInet gem5::ListenSocketUnix MockListenSocket gem5::ListenSocketUnixAbstract gem5::ListenSocketUnixFile

Static Public Member Functions

static void disableAll ()
 
static bool allDisabled ()
 
static void loopbackOnly ()
 

Protected Member Functions

void setListening ()
 
 ListenSocket (const std::string &_name)
 

Static Protected Member Functions

static void cleanup ()
 

Protected Attributes

bool listening = false
 
int fd = -1
 

Static Protected Attributes

static bool listeningDisabled = false
 The following variables are only used by socket unit tests: listeningDisabled, anyListening, bindToLoopback.
 
static bool anyListening = false
 
static bool bindToLoopback = false
 
static int socketCloexec (int domain, int type, int protocol)
 
static int acceptCloexec (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
virtual ~ListenSocket ()
 
virtual int accept ()
 
virtual void listen ()=0
 
virtual void output (std::ostream &os) const =0
 
int getfd () const
 
bool islistening () const
 

Additional Inherited Members

- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 

Detailed Description

Definition at line 46 of file socket.hh.

Constructor & Destructor Documentation

◆ ListenSocket()

gem5::ListenSocket::ListenSocket ( const std::string & _name)
protected

Definition at line 129 of file socket.cc.

Member Function Documentation

◆ accept()

int gem5::ListenSocket::accept ( )
virtual

Reimplemented in gem5::ListenSocketInet.

Definition at line 140 of file socket.cc.

References acceptCloexec(), fd, gem5::Named::name(), and panic_if.

Referenced by gem5::ListenSocketInet::accept().

◆ acceptCloexec()

int gem5::ListenSocket::acceptCloexec ( int sockfd,
struct sockaddr * addr,
socklen_t * addrlen )
static

Definition at line 115 of file socket.cc.

References gem5::X86ISA::addr.

Referenced by accept().

◆ allDisabled()

◆ cleanup()

void gem5::ListenSocket::cleanup ( )
staticprotected

Definition at line 74 of file socket.cc.

References anyListening, bindToLoopback, and listeningDisabled.

Referenced by MockListenSocket::~MockListenSocket().

◆ disableAll()

void gem5::ListenSocket::disableAll ( )
static

Definition at line 82 of file socket.cc.

References anyListening, listeningDisabled, and panic.

Referenced by gem5::pybind_init_core(), and TEST().

◆ getfd()

int gem5::ListenSocket::getfd ( ) const
inline

Definition at line 94 of file socket.hh.

References fd.

Referenced by TEST(), TEST(), and TEST().

◆ islistening()

bool gem5::ListenSocket::islistening ( ) const
inline

Definition at line 95 of file socket.hh.

References listening.

Referenced by TEST(), TEST(), and TEST().

◆ listen()

virtual void gem5::ListenSocket::listen ( )
pure virtual

◆ loopbackOnly()

void gem5::ListenSocket::loopbackOnly ( )
static

Definition at line 96 of file socket.cc.

References anyListening, bindToLoopback, and panic.

Referenced by gem5::pybind_init_core().

◆ output()

virtual void gem5::ListenSocket::output ( std::ostream & os) const
pure virtual

◆ setListening()

void gem5::ListenSocket::setListening ( )
inlineprotected

Definition at line 69 of file socket.hh.

References anyListening, and listening.

Referenced by gem5::ListenSocketInet::listen(), and gem5::ListenSocketUnix::listen().

◆ socketCloexec()

int gem5::ListenSocket::socketCloexec ( int domain,
int type,
int protocol )
static

Member Data Documentation

◆ anyListening

bool gem5::ListenSocket::anyListening = false
staticprotected

Definition at line 54 of file socket.hh.

Referenced by cleanup(), disableAll(), loopbackOnly(), and setListening().

◆ bindToLoopback

bool gem5::ListenSocket::bindToLoopback = false
staticprotected

Definition at line 56 of file socket.hh.

Referenced by cleanup(), gem5::ListenSocketInet::listen(), and loopbackOnly().

◆ fd

int gem5::ListenSocket::fd = -1
protected

◆ listening

bool gem5::ListenSocket::listening = false
protected

◆ listeningDisabled

bool gem5::ListenSocket::listeningDisabled = false
staticprotected

The following variables are only used by socket unit tests: listeningDisabled, anyListening, bindToLoopback.

Definition at line 53 of file socket.hh.

Referenced by allDisabled(), cleanup(), and disableAll().


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

Generated on Tue Jun 18 2024 16:24:12 for gem5 by doxygen 1.11.0