KallistiOS
##version##
|
Network configuration interface. More...
Go to the source code of this file.
Data Structures | |
struct | netcfg |
Network configuration information. More... | |
Macros | |
#define | NETCFG_METHOD_DHCP 0 |
Use DHCP to configure. More... | |
#define | NETCFG_METHOD_STATIC 1 |
Static network configuration. More... | |
#define | NETCFG_METHOD_PPPOE 4 |
Use PPPoE. More... | |
#define | NETCFG_SRC_VMU 0 |
Read from a VMU. More... | |
#define | NETCFG_SRC_FLASH 1 |
Read from the flashrom. More... | |
#define | NETCFG_SRC_CWD 2 |
Read from the working directory. More... | |
#define | NETCFG_SRC_CDROOT 3 |
Read from the root of the CD. More... | |
Typedefs | |
typedef struct netcfg | netcfg_t |
Network configuration information. More... | |
Functions | |
int | netcfg_load_from (const char *fn, netcfg_t *out) |
Load network configuration from a file. More... | |
int | netcfg_load_flash (netcfg_t *out) |
Load network configuration from the Dreamcast's flashrom. More... | |
int | netcfg_load (netcfg_t *out) |
Load network configuration. More... | |
int | netcfg_save_to (const char *fn, const netcfg_t *cfg) |
Save network configuration to a file. More... | |
int | netcfg_save (const netcfg_t *cfg) |
Save network configuration to the first available VMU. More... | |
Network configuration interface.
This file provides a common interface for reading and writing the network configuration on KOS. The interface can read from the flashrom on the Dreamcast or from a file (such as on a VMU or the like), and can write data back to a file.
The data that is written out by this code is written in a relatively easy to parse text-based format.
Network configuration information.
This structure contains information about the network configuration of the system, as set up by the user.
int netcfg_load | ( | netcfg_t * | out | ) |
Load network configuration.
This function loads the network configuration data, searching in multiple locations to attempt to find a file with a stored configurtion. This function will attempt to read the configuration from each VMU first (from a file named net.cfg), then it will try the flashrom, followed by the current working directory, and lastly the root of the CD.
out | Buffer to store the parsed configuraiton. |
int netcfg_load_flash | ( | netcfg_t * | out | ) |
Load network configuration from the Dreamcast's flashrom.
This function loads the network configuration that is stored in flashrom of the Dreamcast, parsing it into a netcfg_t.
out | Buffer to store the parsed configuration. |
int netcfg_load_from | ( | const char * | fn, |
netcfg_t * | out | ||
) |
Load network configuration from a file.
This function loads the network configuration that is stored in the given file to the network configuration structure passed in. This function will also handle files on the VMU with the VMU specific header attached without any extra work required.
fn | The file to read the configuration from. |
out | Buffer to store the parsed configuration. |
int netcfg_save | ( | const netcfg_t * | cfg | ) |
Save network configuration to the first available VMU.
This function saves the network configuration to first VMU that it finds. It will not retry if the first VMU doesn't have enough space to hold the file.
cfg | The configuration to save. |
int netcfg_save_to | ( | const char * | fn, |
const netcfg_t * | cfg | ||
) |
Save network configuration to a file.
This function saves the network configuration to the specified file. This function will automatically prepend the appropriate header if it is saved to a VMU.
fn | The file to save to. |
cfg | The configuration to save. |