#include <arpa/inet.h>
#include <errno.h>
#include <net/if.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
Go to the source code of this file.
|
size_t | strlcpy (char *dst, const char *src, size_t siz) |
|
int | ifconfig (const char *ifname, const char *addr, const char *mask, int up) |
|
- Author
- Claudio Matsuoka
-
Joachim Wiberg
- Date
- 2008-2021
- Copyright
- MIT License
Definition in file ifconfig.c.
◆ ifconfig()
int ifconfig |
( |
const char * | ifname, |
|
|
const char * | addr, |
|
|
const char * | mask, |
|
|
int | up ) |
Basic ifconfig like operations on an interface
- Parameters
-
ifname | Name of interface to operate on |
addr | If up then set this optional IPv4 address |
mask | If up and addr , and addr is not INADDR_ANY , then set netmask |
up | Control IFF_UP flag on interface |
- Returns
- POSIX OK(0) on success, or non-zero on error.
Definition at line 53 of file ifconfig.c.
◆ strlcpy()
size_t strlcpy |
( |
char * | dst, |
|
|
const char * | src, |
|
|
size_t | dsize ) |
|
extern |
Safe version of strncpy() from OpenBSD
- Parameters
-
dst | Destination string |
src | Source string |
dsize | Total maximum size of dst |
This function copies string src
to buffer dst
of size dsize
bytes. At most dsize-1 chars will be copied. Always NUL terminates (unless dsize==0).
- Returns
- strlen(src); if retval >= dsize, truncation occurred.
Definition at line 44 of file strlcpy.c.