Go to the documentation of this file.
52 Size numberOfMounts = 0;
62 for (
Size i = 0; i < numberOfMounts; i++)
64 if (mounts[i].path[0] &&
strncmp(mounts[i].path,
"/network/", 9) == 0)
77 ether <<
"/network/" << deviceName <<
"/ethernet/address";
78 ipv4 <<
"/network/" << deviceName <<
"/ipv4/address";
79 out << deviceName <<
" ipv4 ";
89 r =
read(fd, &ipAddr,
sizeof(ipAddr));
103 r =
read(fd, ðerAddress,
sizeof(etherAddress));
int strncmp(const char *dest, const char *src, size_t count)
Compare two strings, by only a maximum number of bytes.
Represents a mounted filesystem.
FileSystemClient provides a simple interface to a FileSystemServer.
POSIX-compatible application.
int open(const char *path, int oflag,...)
Open file relative to directory file descriptor.
void setDescription(const String &desc)
Set program description.
ssize_t read(int fildes, void *buf, size_t nbyte)
Read from a file.
virtual Result exec()
Execute the application event loop.
#define DEBUG(msg)
Output a debug message to standard output.
Ethernet network address.
int printf(const char *format,...)
Output a formatted string to standard output.
int close(int fildes)
Close a file descriptor.
NetCtl(int argc, char **argv)
Class constructor.
unsigned int Size
Any sane size indicator cannot go negative.
FileSystemMount * getFileSystems(Size &numberOfMounts) const
Get file system mounts table.
Result registerPositional(const char *name, const char *description, Size count=1)
Register a positional argument.
static const String toString(const Address address)
Convert address to string.
Result showDevice(const char *deviceName)
Output device information.
ArgumentParser & parser()
Get program arguments parser.
static const String toString(const Address address)
Convert address to string.
virtual ~NetCtl()
Class destructor.
virtual Result initialize()
Initialize the application.
#define O_RDONLY
Open for reading only.