The Pedigree Project 0.1
Public Member Functions | Private Attributes | List of all members
PosixNetworkNamespace Class Reference
+ Collaboration diagram for PosixNetworkNamespace:

Public Member Functions

 PosixNetworkNamespace (const UserNamespaceRef &owner)
 
const UserNamespaceRef & owner () const
 
uint64_t identity () const
 
bool usable () const
 
int configureAddress (uint32_t address, unsigned prefix, bool exclusive)
 
int configureLink (uint32_t flags, uint32_t changed)
 
uint32_t flags () const
 
uint32_t address () const
 
uint64_t reserve (int type, uint32_t address, uint16_t &port)
 
void release (uint64_t token)
 
uint32_t reserveRoutePort (uint32_t preferred, bool fixed)
 
void releaseRoutePort (uint32_t port)
 
bool find (int type, uint32_t address, uint16_t port, uint32_t &boundAddress, uint64_t &token)
 

Private Attributes

const UserNamespaceRef m_Owner
 
const uint64_t m_Identity
 
Mutex m_Lock
 
bool m_Up = false
 
uint32_t m_Address = 0
 
uint16_t m_NextPort = 32768
 
uint64_t m_NextToken = 0
 
Tree< uint64_t, uint64_t > m_Bindings
 
Tree< uint32_t, bool > m_RoutePorts
 
uint32_t m_NextRoutePort = 0x80000000
 

Detailed Description

Definition at line 17 of file network-namespace.h.

Constructor & Destructor Documentation

◆ PosixNetworkNamespace()

PosixNetworkNamespace::PosixNetworkNamespace ( const UserNamespaceRef &  owner)
explicit

Definition at line 22 of file network-namespace.cc.

Member Function Documentation

◆ address()

uint32_t PosixNetworkNamespace::address ( ) const

Definition at line 42 of file network-namespace.cc.

◆ configureAddress()

int PosixNetworkNamespace::configureAddress ( uint32_t  address,
unsigned  prefix,
bool  exclusive 
)

Definition at line 46 of file network-namespace.cc.

◆ configureLink()

int PosixNetworkNamespace::configureLink ( uint32_t  flags,
uint32_t  changed 
)

Definition at line 60 of file network-namespace.cc.

◆ find()

bool PosixNetworkNamespace::find ( int  type,
uint32_t  address,
uint16_t  port,
uint32_t &  boundAddress,
uint64_t &  token 
)

Definition at line 150 of file network-namespace.cc.

◆ flags()

uint32_t PosixNetworkNamespace::flags ( ) const

Definition at line 38 of file network-namespace.cc.

◆ identity()

uint64_t PosixNetworkNamespace::identity ( ) const
inline

Definition at line 23 of file network-namespace.h.

◆ owner()

const UserNamespaceRef & PosixNetworkNamespace::owner ( ) const
inline

Definition at line 20 of file network-namespace.h.

◆ release()

void PosixNetworkNamespace::release ( uint64_t  token)

Definition at line 120 of file network-namespace.cc.

◆ releaseRoutePort()

void PosixNetworkNamespace::releaseRoutePort ( uint32_t  port)

Definition at line 146 of file network-namespace.cc.

◆ reserve()

uint64_t PosixNetworkNamespace::reserve ( int  type,
uint32_t  address,
uint16_t &  port 
)

Definition at line 74 of file network-namespace.cc.

◆ reserveRoutePort()

uint32_t PosixNetworkNamespace::reserveRoutePort ( uint32_t  preferred,
bool  fixed 
)

Definition at line 129 of file network-namespace.cc.

◆ usable()

bool PosixNetworkNamespace::usable ( ) const

Definition at line 34 of file network-namespace.cc.

Member Data Documentation

◆ m_Address

uint32_t PosixNetworkNamespace::m_Address = 0
private

Definition at line 42 of file network-namespace.h.

◆ m_Bindings

Tree<uint64_t, uint64_t> PosixNetworkNamespace::m_Bindings
private

Definition at line 45 of file network-namespace.h.

◆ m_Identity

const uint64_t PosixNetworkNamespace::m_Identity
private

Definition at line 39 of file network-namespace.h.

◆ m_Lock

Mutex PosixNetworkNamespace::m_Lock
mutableprivate

Definition at line 40 of file network-namespace.h.

◆ m_NextPort

uint16_t PosixNetworkNamespace::m_NextPort = 32768
private

Definition at line 43 of file network-namespace.h.

◆ m_NextRoutePort

uint32_t PosixNetworkNamespace::m_NextRoutePort = 0x80000000
private

Definition at line 47 of file network-namespace.h.

◆ m_NextToken

uint64_t PosixNetworkNamespace::m_NextToken = 0
private

Definition at line 44 of file network-namespace.h.

◆ m_Owner

const UserNamespaceRef PosixNetworkNamespace::m_Owner
private

Definition at line 38 of file network-namespace.h.

◆ m_RoutePorts

Tree<uint32_t, bool> PosixNetworkNamespace::m_RoutePorts
private

Definition at line 46 of file network-namespace.h.

◆ m_Up

bool PosixNetworkNamespace::m_Up = false
private

Definition at line 41 of file network-namespace.h.


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