wavelength 1.0.0
Loading...
Searching...
No Matches
Libnet Class Reference

The Libnet module serves the inet and inetctl libraries to the EE through a multi-client SIF RPC server. More...

#include <libnetb.h>

Collaboration diagram for Libnet:

Public Types

enum  Function {
  kFunctionInet6 = 1 , kFunctionInet7 = 2 , kFunctionInet8 = 3 , kFunctionRecv = 4 ,
  kFunctionSend = 5 , kFunctionName2Address = 6 , kFunctionAddress2String = 7 , kFunctionInet24 = 8 ,
  kFunctionInterfaceControl = 9 , kFunctionInet27 = 10 , kFunctionInet30 = 11 , kFunctionInet36 = 12 ,
  kFunctionRecvFrom = 13 , kFunctionSendTo = 14 , kFunctionInet11 = 15 , kFunctionInet41 = 16 ,
  kFunctionInet38 = 17 , kFunctionInet14 = 18 , kFunctionControl = 19 , kFunctionInet16 = 20 ,
  kFunctionOpenEvents = 30 , kFunctionCloseEvents = 31 , kFunctionInetCtl4 = 32 , kFunctionWaitInterfaceUp = 33 ,
  kFunctionWaitInterfaceDown = 34 , kFunctionGetEvent = 35 , kFunctionInetCtl5 = 50 , kFunctionInetCtl6 = 51 ,
  kFunctionInetCtl7 = 52 , kFunctionGetState = 53 , kFunctionStartAsyncRead = 100 , kFunctionStartAsyncSend = 101 ,
  kFunctionCloseAsync = 102 , kFunctionDumpState = 103
}
 RPC function numbers, with the record types of their arguments and replies. More...

Static Public Member Functions

static int SendToEe (const void *data, void *destination, int size)
 Copy a buffer to EE memory by SIF DMA and wait for the transfer.
static void PrintInetError (int error)
 Print an inet error code and its description.
static int CreateNamedThread (ThreadParam *param, const char *name, void(*entry)(void *), int stackSize, int priority, void *argument)
 Create and start a thread with an argument.
static const char * GetVersion ()
 Read the version text.
static bool FormatBuildDate (char *text, int size)
 Write the build date and time as MM.DD.YYYY.hh.mm.ss.
static void PrintSendDelay ()
 Print the delay between sends.
static void ParseArguments (int argc, char **argv)
 Read the module arguments into sConfig.
static int StartRpcThread ()
 Start the thread that registers the RPC server.

Static Public Attributes

static constexpr unsigned int kRpcServerId = 0x80001201
 SIF RPC server identifier of the module.
static int sVerbose
 Nonzero for messages about each event and retry.
static const char * sVersion
 Version text.
static int sSendDelay
 Microseconds between sends.
static LibnetConfig sConfig
 Settings from the module arguments.

Detailed Description

The Libnet module serves the inet and inetctl libraries to the EE through a multi-client SIF RPC server.

Most RPC functions forward one library call. Others queue the inetctl events and run asynchronous transfers on connections (see AsyncInfo). Its arguments are -verbose and -send_delay=<milliseconds>.

The module was built without RTTI. The name comes from the module's library name.

Member Enumeration Documentation

◆ Function

RPC function numbers, with the record types of their arguments and replies.

Enumerator
kFunctionInet6 

LibnetParamArgs to inet_6().

kFunctionInet7 

LibnetConnectionArgs to inet_7().

kFunctionInet8 

LibnetConnectionArgs to inet_8().

kFunctionRecv 

LibnetTransferArgs, LibnetRecvReply.

kFunctionSend 

LibnetSendArgs, LibnetFlagsReply.

kFunctionName2Address 

LibnetName2AddressArgs, LibnetAddressReply.

kFunctionAddress2String 

LibnetAddress2StringArgs, LibnetAddress2StringReply.

kFunctionInet24 

LibnetBufferArgs, LibnetBufferReply.

kFunctionInterfaceControl 

LibnetControlArgs, LibnetControlReply.

kFunctionInet27 

LibnetBufferArgs, LibnetBufferReply.

kFunctionInet30 

LibnetBufferArgs, LibnetBufferReply.

kFunctionInet36 

LibnetValueArgs to inet_36().

kFunctionRecvFrom 

LibnetTransferArgs, LibnetRecvFromReply.

kFunctionSendTo 

LibnetSendToArgs, LibnetFlagsReply.

kFunctionInet11 

LibnetConnectionArgs to inet_11().

kFunctionInet41 

No arguments, to inet_41().

kFunctionInet38 

LibnetPairArgs, LibnetBufferReply.

kFunctionInet14 

LibnetInet14Args to inet_14().

kFunctionControl 

LibnetControlArgs, LibnetControlReply.

kFunctionInet16 

LibnetPairArgs, LibnetOffsetBufferReply.

kFunctionOpenEvents 

Start queueing the inetctl events.

kFunctionCloseEvents 

Stop queueing the inetctl events.

kFunctionInetCtl4 

LibnetEnvArgs to inetctl_4().

kFunctionWaitInterfaceUp 

Wait for InetEventQueue::kInterfaceUp.

kFunctionWaitInterfaceDown 

Wait for InetEventQueue::kInterfaceDown.

kFunctionGetEvent 

LibnetEventReply.

kFunctionInetCtl5 

LibnetValueArgs to inetctl_5().

kFunctionInetCtl6 

LibnetValueArgs to inetctl_6().

kFunctionInetCtl7 

LibnetValueArgs to inetctl_7().

kFunctionGetState 

LibnetValueArgs, LibnetStateReply.

kFunctionStartAsyncRead 

An AsyncInfo to receive with.

kFunctionStartAsyncSend 

An AsyncInfo to send with.

kFunctionCloseAsync 

LibnetCloseAsyncArgs.

kFunctionDumpState 

Print the state of the module.

Member Function Documentation

◆ SendToEe()

int Libnet::SendToEe ( const void * data,
void * destination,
int size )
static

Copy a buffer to EE memory by SIF DMA and wait for the transfer.

Parameters
dataSource.
destinationDestination in EE memory.
sizeByte count.
Returns
Zero, 2 for a null argument or no bytes, or 4 when the DMA queue is full.
Ghidra address:
NTSC-U/C: 0x00001240
Ghidra address:
PAL: 0x00001220

◆ PrintInetError()

void Libnet::PrintInetError ( int error)
static

Print an inet error code and its description.

Parameters
errorA #sceInetError, or a nonnegative value for no error.
Ghidra address:
NTSC-U/C: 0x0000343c
Ghidra address:
PAL: 0x000032ec

◆ CreateNamedThread()

int Libnet::CreateNamedThread ( ThreadParam * param,
const char * name,
void(* entry )(void *),
int stackSize,
int priority,
void * argument )
static

Create and start a thread with an argument.

Parameters
paramParameters with the attribute and the option set.
nameThread name for messages.
entryEntry point.
stackSizeStack size.
priorityPriority.
argumentArgument of the entry point.
Returns
The thread identifier, or -1.
Ghidra address:
NTSC-U/C: 0x0000284c
Ghidra address:
PAL: 0x00002704

◆ GetVersion()

const char * Libnet::GetVersion ( )
static

Read the version text.

Returns
sVersion.
Ghidra address:
NTSC-U/C: 0x00000b50
Ghidra address:
PAL: 0x00000b40

◆ FormatBuildDate()

bool Libnet::FormatBuildDate ( char * text,
int size )
static

Write the build date and time as MM.DD.YYYY.hh.mm.ss.

Parameters
textReceives the text, or null.
sizeSize of text.
Returns
True when text is not null.
Ghidra address:
NTSC-U/C: 0x00000b5c
Ghidra address:
PAL: 0x00000b4c

◆ PrintSendDelay()

void Libnet::PrintSendDelay ( )
static

Print the delay between sends.

Ghidra address:
NTSC-U/C: 0x000011fc
Ghidra address:
PAL: 0x000011dc

◆ ParseArguments()

void Libnet::ParseArguments ( int argc,
char ** argv )
static

Read the module arguments into sConfig.

Parameters
argcArgument count.
argvArguments.
Ghidra address:
NTSC-U/C: 0x00000a38
Ghidra address:
PAL: 0x00000a34

◆ StartRpcThread()

int Libnet::StartRpcThread ( )
static

Start the thread that registers the RPC server.

Returns
#RESIDENT_END, or #NO_RESIDENT_END when the thread does not start.
Ghidra address:
NTSC-U/C: 0x000009b0
Ghidra address:
PAL: 0x000009b0

Member Data Documentation

◆ kRpcServerId

unsigned int Libnet::kRpcServerId = 0x80001201
staticconstexpr

SIF RPC server identifier of the module.

◆ sVerbose

int Libnet::sVerbose
static

Nonzero for messages about each event and retry.

Set by -verbose.

◆ sVersion

const char* Libnet::sVersion
static

Version text.

◆ sSendDelay

int Libnet::sSendDelay
static

Microseconds between sends.

◆ sConfig

LibnetConfig Libnet::sConfig
static

Settings from the module arguments.


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