gem5  v21.2.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Private Member Functions | List of all members
gem5::ListenSocket Class Reference

#include <socket.hh>

Inheritance diagram for gem5::ListenSocket:
MockListenSocket

Public Member Functions

 ListenSocket ()
 
virtual ~ListenSocket ()
 
virtual int accept (bool nodelay=false)
 
virtual bool listen (int port, bool reuse=true)
 
int getfd () const
 
bool islistening () const
 

Static Public Member Functions

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

Static Protected Member Functions

static void cleanup ()
 

Protected Attributes

bool listening
 
int fd
 

Static Protected Attributes

static bool listeningDisabled = false
 The following variables are only used by socket unit tests: listeningDisabled, anyListening, bindToLoopback. More...
 
static bool anyListening = false
 
static bool bindToLoopback = false
 

Static Private Member Functions

static int socketCloexec (int domain, int type, int protocol)
 
static int acceptCloexec (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 

Detailed Description

Definition at line 38 of file socket.hh.

Member Function Documentation

◆ acceptCloexec()

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

Definition at line 96 of file socket.cc.

References gem5::X86ISA::addr.

Referenced by accept().

◆ allDisabled()

bool gem5::ListenSocket::allDisabled ( )
static

◆ cleanup()

void gem5::ListenSocket::cleanup ( )
staticprotected

Definition at line 55 of file socket.cc.

References anyListening, bindToLoopback, and listeningDisabled.

◆ disableAll()

void gem5::ListenSocket::disableAll ( )
static

Definition at line 63 of file socket.cc.

References anyListening, listeningDisabled, and panic.

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

◆ loopbackOnly()

void gem5::ListenSocket::loopbackOnly ( )
static

Definition at line 77 of file socket.cc.

References anyListening, bindToLoopback, and panic.

Referenced by gem5::pybind_init_core().

◆ socketCloexec()

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

Definition at line 87 of file socket.cc.

References gem5::ArmISA::domain, and gem5::X86ISA::type.

Referenced by listen().

Member Data Documentation

◆ anyListening

bool gem5::ListenSocket::anyListening = false
staticprotected

Definition at line 46 of file socket.hh.

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

◆ bindToLoopback

bool gem5::ListenSocket::bindToLoopback = false
staticprotected

Definition at line 48 of file socket.hh.

Referenced by cleanup(), listen(), and loopbackOnly().

◆ fd

int gem5::ListenSocket::fd
protected

Definition at line 58 of file socket.hh.

Referenced by accept(), getfd(), listen(), and ~ListenSocket().

◆ listening

bool gem5::ListenSocket::listening
protected

Definition at line 57 of file socket.hh.

Referenced by islistening(), and listen().

◆ listeningDisabled

bool gem5::ListenSocket::listeningDisabled = false
staticprotected

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

Definition at line 45 of file socket.hh.

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


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

Generated on Tue Feb 8 2022 11:47:55 for gem5 by doxygen 1.8.17