|
EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the definition of the uci utilities. More...
Go to the source code of this file.
Data Structures | |
| struct | uctx |
| struct | hostapd_params |
Functions | |
| struct uctx * | uwrt_init_context (const char *path) |
| Initialises the uci context. More... | |
| void | uwrt_free_context (struct uctx *context) |
| Frees the uci context. More... | |
| UT_array * | uwrt_get_interfaces (const struct uctx *context, const char *ifname) |
Get the array of struct netif_info_t for each available interface. More... | |
| int | uwrt_set_interface_ip (const struct uctx *context, const char *ifname, const char *ip_addr, const char *netmask) |
| Assigns an IP to an interface. More... | |
| int | uwrt_create_interface (const struct uctx *context, const char *ifname, const char *type, const char *ip_addr, const char *brd_addr, const char *netmask) |
| Creates and interface and assigns an IP. More... | |
| int | uwrt_commit_section (const struct uctx *context, const char *section) |
| Commit a uci section. More... | |
| int | uwrt_gen_dnsmasq_instance (const struct uctx *context, const struct string_queue *ifname_queue, const UT_array *server_array, const char *leasefile, const char *scriptfile) |
| Generates a dnsmasq uci instance. More... | |
| int | uwrt_add_dhcp_pool (const struct uctx *context, const char *ifname, const char *ip_addr_low, const char *ip_addr_upp, const char *subnet_mask, const char *lease_time) |
| Adds a dhcp pool entry. More... | |
| int | uwrt_gen_hostapd_instance (const struct uctx *context, const struct hostapd_params *params) |
| Generate the hostapd config. More... | |
| int | uwrt_gen_firewall_zone (const struct uctx *context, const char *brname) |
| Generate a firewall zone for a bridge. More... | |
| int | uwrt_add_firewall_nat (const struct uctx *context, const char *brname, const char *ip_addr, const char *nat_name) |
| Adds a firewall rule for an IP address. More... | |
| int | uwrt_delete_firewall_nat (const struct uctx *context, const char *ip_addr) |
| Deletes a firewall rule for an IP address. More... | |
| int | uwrt_add_firewall_bridge (const struct uctx *context, const char *sip, const char *sbr, const char *dip, const char *dbr) |
| Adds a firewall bridge rule for two IP addresses. More... | |
| int | uwrt_delete_firewall_bridge (const struct uctx *context, const char *sip, const char *dip) |
| Deletes a firewall bridge rule for two IP addresses. More... | |
| int | uwrt_cleanup_firewall (const struct uctx *context) |
| Removes all the firewall rules. More... | |
File containing the definition of the uci utilities.
| int uwrt_add_dhcp_pool | ( | const struct uctx * | context, |
| const char * | ifname, | ||
| const char * | ip_addr_low, | ||
| const char * | ip_addr_upp, | ||
| const char * | subnet_mask, | ||
| const char * | lease_time | ||
| ) |
Adds a dhcp pool entry.
| context | The uci context |
| ifname | The interface name |
| ip_addr_low | Interface string IP address lower bound |
| ip_addr_upp | Interface string IP address upper bound |
| subnet_mask | Interface string IP subnet mask |
| lease_time | Interface lease time string |
| int uwrt_add_firewall_bridge | ( | const struct uctx * | context, |
| const char * | sip, | ||
| const char * | sbr, | ||
| const char * | dip, | ||
| const char * | dbr | ||
| ) |
Adds a firewall bridge rule for two IP addresses.
| context | The uci context |
| sip | The source IP address |
| sbr | The source bridge interface name |
| dip | The destination IP address |
| dbr | The destination bridge interface name |
| int uwrt_add_firewall_nat | ( | const struct uctx * | context, |
| const char * | brname, | ||
| const char * | ip_addr, | ||
| const char * | nat_name | ||
| ) |
Adds a firewall rule for an IP address.
| context | The uci context |
| brname | The bridge name |
| ip_addr | The IP address |
| nat_name | The NAT bridge name |
| int uwrt_cleanup_firewall | ( | const struct uctx * | context | ) |
Removes all the firewall rules.
| context | The uci context |
| int uwrt_commit_section | ( | const struct uctx * | context, |
| const char * | section | ||
| ) |
Commit a uci section.
| context | The uci context |
| section | The uci section |
| int uwrt_create_interface | ( | const struct uctx * | context, |
| const char * | ifname, | ||
| const char * | type, | ||
| const char * | ip_addr, | ||
| const char * | brd_addr, | ||
| const char * | netmask | ||
| ) |
Creates and interface and assigns an IP.
| context | The uci context |
| ifname | The interface name |
| type | The interface type |
| ip_addr | The interface IP4 address |
| brd_addr | The interface IP4 broadcast address |
| netmask | The interface IP4 netmask |
| int uwrt_delete_firewall_bridge | ( | const struct uctx * | context, |
| const char * | sip, | ||
| const char * | dip | ||
| ) |
Deletes a firewall bridge rule for two IP addresses.
| context | The uci context |
| sip | The source IP address |
| dip | The destination IP address |
| int uwrt_delete_firewall_nat | ( | const struct uctx * | context, |
| const char * | ip_addr | ||
| ) |
Deletes a firewall rule for an IP address.
| context | The uci context |
| ip_addr | The IP address |
| void uwrt_free_context | ( | struct uctx * | context | ) |
Frees the uci context.
| context | The uci context |
| int uwrt_gen_dnsmasq_instance | ( | const struct uctx * | context, |
| const struct string_queue * | ifname_queue, | ||
| const UT_array * | server_array, | ||
| const char * | leasefile, | ||
| const char * | scriptfile | ||
| ) |
Generates a dnsmasq uci instance.
| context | The uci context |
| ifname_queue | The interface queue |
| server_array | The array of servers |
| leasefile | The lease file path string |
| scriptfile | The script file path string |
| int uwrt_gen_firewall_zone | ( | const struct uctx * | context, |
| const char * | brname | ||
| ) |
Generate a firewall zone for a bridge.
| context | The uci context |
| brname | The bridge name |
| int uwrt_gen_hostapd_instance | ( | const struct uctx * | context, |
| const struct hostapd_params * | params | ||
| ) |
Generate the hostapd config.
| context | The uci context |
| params | The hostapd params |
| UT_array* uwrt_get_interfaces | ( | const struct uctx * | context, |
| const char * | ifname | ||
| ) |
Get the array of struct netif_info_t for each available interface.
| context | The uci context |
| ifname | The interface name, if NULL return all interfaces |
struct netif_info_t This return variable must be cleaned up by utarray_free(). | struct uctx* uwrt_init_context | ( | const char * | path | ) |
Initialises the uci context.
| path | The path string to the config folder |
NULL on error. This return variable must be cleaned up by uwrt_free_context(). | int uwrt_set_interface_ip | ( | const struct uctx * | context, |
| const char * | ifname, | ||
| const char * | ip_addr, | ||
| const char * | netmask | ||
| ) |
Assigns an IP to an interface.
| context | The uci context |
| ifname | The interface name |
| ip_addr | The interface IP4 address |
| netmask | The interface IP4 netmask |