EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the definition of the ip generic interface utilities. More...
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include "allocs.h"
#include "log.h"
#include "net.h"
#include "os.h"
#include "ipgen.h"
Functions | |
struct ipgenctx * | ipgen_init_context (char *path) |
Initialises the ipgen context. More... | |
void | ipgen_free_context (struct ipgenctx *context) |
Frees the ipgen context. More... | |
int | run_ip (const char *path, const char *const argv[]) |
int | ipgen_new_interface (const char *path, const char *ifname, const char *type) |
int | ipgen_set_interface_ip (const struct ipgenctx *context, const char *ifname, const char *ip_addr, const char *brd_addr, const char *subnet_mask) |
Set the IP address for an interface. More... | |
int | ipgen_set_interface_state (const char *path, const char *ifname, bool state) |
int | ipgen_create_interface (const struct ipgenctx *context, const char *ifname, const char *type, const char *ip_addr, const char *brd_addr, const char *subnet_mask) |
Creates and interface and assigns an IP. More... | |
int | ipgen_reset_interface (const struct ipgenctx *context, const char *ifname) |
Resets the interface. More... | |
File containing the definition of the ip generic interface utilities.
int ipgen_create_interface | ( | const struct ipgenctx * | context, |
const char * | ifname, | ||
const char * | type, | ||
const char * | ip_addr, | ||
const char * | brd_addr, | ||
const char * | subnet_mask | ||
) |
Creates and interface and assigns an IP.
context | The ipgen context interface |
ifname | The interface name |
type | The interface type |
ip_addr | The interface IP4 address |
brd_addr | The interface IP4 broadcast address |
subnet_mask | The interface IP4 subnet mask |
void ipgen_free_context | ( | struct ipgenctx * | context | ) |
Frees the ipgen context.
context | The ipgen context |
struct ipgenctx* ipgen_init_context | ( | char * | path | ) |
Initialises the ipgen context.
path | The path string to the ip command |
int ipgen_new_interface | ( | const char * | path, |
const char * | ifname, | ||
const char * | type | ||
) |
int ipgen_reset_interface | ( | const struct ipgenctx * | context, |
const char * | ifname | ||
) |
Resets the interface.
context | The ipgen context interface |
ifname | The interface name |
int ipgen_set_interface_ip | ( | const struct ipgenctx * | context, |
const char * | ifname, | ||
const char * | ip_addr, | ||
const char * | brd_addr, | ||
const char * | subnet_mask | ||
) |
Set the IP address for an interface.
context | The ipgen context interface |
ifname | The interface name |
ip_addr | The interface IP4 address |
brd_addr | The interface IP4 broadcast address |
subnet_mask | The interface IP4 subnet mask |
int ipgen_set_interface_state | ( | const char * | path, |
const char * | ifname, | ||
bool | state | ||
) |
int run_ip | ( | const char * | path, |
const char *const | argv[] | ||
) |