vmware / network-config-manager

Network configuration manager is utility for easily configuring networking on a linux system
Other
34 stars 10 forks source link

Requires get APIs corresponding to each configure API in public Header #77

Closed jaankit closed 3 years ago

jaankit commented 3 years ago

In include/network-config-manager.h

I see following APIs to configure the network:

int ncm_link_add_default_gateway(int argc, char *argv[]);

int ncm_link_set_dhcp4_section(int argc, char *argv[]);
int ncm_link_set_dhcp6_section(int argc, char *argv[]);

int ncm_link_set_dhcp_client_duid(int argc, char *argv[]);

int ncm_link_set_mode(int argc, char *argv[]);
int ncm_link_set_network_section_bool(int argc, char *argv[]);
int ncm_link_update_state(int argc, char *argv[]);

int ncm_link_enable_ipv6(int argc, char *argv[]);

int ncm_revert_resolve_link(int argc, char *argv[]);

int ncm_create_vlan(int argc, char *argv[]);
int ncm_create_bridge(int argc, char *argv[]);
int ncm_create_bond(int argc, char *argv[]);
int ncm_create_vxlan(int argc, char *argv[]);
int ncm_create_macvlan(int argc, char *argv[]);
int ncm_create_ipvlan(int argc, char *argv[]);
int ncm_create_vrf(int argc, char *argv[]);
int ncm_create_veth(int argc, char *argv[]);
int ncm_create_tunnel(int argc, char *argv[]);
int ncm_create_wireguard_tunnel(int argc, char *argv[]);

But there are no corresponding get APIs to check if the above configuration actually done correctly or not.

Also, i think there is no need of show APIs in public Header for development using ncm-devel like below:

int ncm_link_status(int argc, char *argv[]);
int ncm_show_dns_server(int argc, char *argv[]);
int ncm_show_dns_server_domains(int argc, char *argv[]);
int ncm_show_version(void);   --> we can replace it with ncm_get_version(char **version);
int ncm_nft_show_tables(int argc, char *argv[]);
int ncm_nft_show_chains(int argc, char *argv[]);
int ncm_nft_show_rules(int argc, char *argv[]);

I think only configure and get API are required.

ssahani commented 3 years ago

The get api is show the netdev is created or not ,same as ethernets. Those are not required.

jaankit commented 3 years ago

The get api is show the netdev is created or not ,same as ethernets. Those are not required.

In client-server environment, where user can configure the network of server machine from client machine only with proper authentication. After configuring the network if user wanted to check if it is configured properly or not. Then it would require get APIs to invoke and get the server network configuration output in client machine. Would be helpful for project like pmd.

ssahani commented 3 years ago

Closing. via https://github.com/vmware/network-config-manager/commit/3d61dca32a3a292876d9bad5b09c547cb92da134