2019-06-18 07:54:42 +00:00
|
|
|
#ifndef PARSEFILE_H_
|
|
|
|
#define PARSEFILE_H_
|
|
|
|
|
2019-08-08 03:57:20 +00:00
|
|
|
#include <net/if.h>
|
|
|
|
|
2019-08-02 07:33:53 +00:00
|
|
|
#include "rpc_common.h"
|
|
|
|
|
2019-09-19 09:26:25 +00:00
|
|
|
#include "ipconfig.h"
|
2019-08-08 03:57:20 +00:00
|
|
|
#define PROC_NET_DEV "/proc/net/dev"
|
|
|
|
#define ETC_NETWORK_IFS "/etc/network/interfaces"
|
|
|
|
#define ETC_PRODUCT "/etc/product.conf"
|
2019-09-19 09:26:25 +00:00
|
|
|
#define PROC_NET_IFINET6 "/proc/net/if_inet6"
|
2019-08-08 03:57:20 +00:00
|
|
|
|
2019-06-28 10:36:24 +00:00
|
|
|
#define IF_BUFF_LEN 128
|
2019-06-18 07:54:42 +00:00
|
|
|
|
2019-08-02 06:59:46 +00:00
|
|
|
ret_code if_conf_file_add(char *if_name);
|
|
|
|
ret_code if_conf_file_del(char *if_name);
|
|
|
|
ret_code if_conf_file_set(char *if_name, char *conf_name, char *conf_buff);
|
|
|
|
ret_code if_conf_file_get(char *if_name, char *conf_name, char *conf_buff);
|
|
|
|
|
2019-07-03 02:44:56 +00:00
|
|
|
void ip_conf_file_set(char *if_name, char *conf_name, char *conf_buff);
|
2019-09-19 09:26:25 +00:00
|
|
|
void ipv6_conf_file_set(char *if_name, char *conf_name, char *conf_buff);
|
|
|
|
|
2019-07-03 02:44:56 +00:00
|
|
|
void ip_conf_file_del(char *if_name, char *conf_buff);
|
2019-09-19 09:26:25 +00:00
|
|
|
void ipv6_conf_file_del(char *if_name, char *conf_buff);
|
2019-06-18 07:54:42 +00:00
|
|
|
|
2019-08-02 06:59:46 +00:00
|
|
|
ret_code del_sub_string(char *str_in,char *str_sub);
|
2019-08-08 09:56:56 +00:00
|
|
|
int if_read_dev_file(struct ifreq *ifcfg, int max_port);
|
2019-09-19 09:26:25 +00:00
|
|
|
int if_read_stats_file(if_info_t *if_info);
|
2019-08-08 09:56:56 +00:00
|
|
|
int if_read_conf_file(struct ifreq *ifcfg, int max_port);
|
2019-08-09 03:19:03 +00:00
|
|
|
ret_code if_role_file_get(char *if_name, char *conf_buff);
|
2019-08-02 06:59:46 +00:00
|
|
|
|
2019-06-18 07:54:42 +00:00
|
|
|
#endif
|