MOD aaa-12 配置传入参数修改为json格式
SOL 配置传入参数修改为json格式 修改人:zhangliang 检视人:zhangliang
This commit is contained in:
parent
d76e2b8b3f
commit
902bfbe312
|
@ -13,7 +13,7 @@
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
|
||||||
#define MAX_IF_NUM 32
|
#define MAX_IF_NUM 32
|
||||||
#define DOT_IP_IF_NUM 32
|
#define DOT_IP_STR 32
|
||||||
|
|
||||||
#define INTERFACE_NAMSIZ 20
|
#define INTERFACE_NAMSIZ 20
|
||||||
/* Max bit/byte length of IPv4 address. */
|
/* Max bit/byte length of IPv4 address. */
|
||||||
|
@ -72,7 +72,7 @@ struct _ip_config_string {
|
||||||
int config_type;
|
int config_type;
|
||||||
char ifname[INTERFACE_NAMSIZ];
|
char ifname[INTERFACE_NAMSIZ];
|
||||||
int family;
|
int family;
|
||||||
char ipaddr[IP_STR_LEN];
|
char ipaddr[DOT_IP_STR];
|
||||||
int prefixlen;
|
int prefixlen;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ ret_code ip_config_format_json(ip_config_t *config_buff, pointer output, int *ou
|
||||||
ip_config->prefixlen = config_buff->prefixlen;
|
ip_config->prefixlen = config_buff->prefixlen;
|
||||||
|
|
||||||
strncpy(ip_config->ifname, config_buff->ifname, INTERFACE_NAMSIZ);
|
strncpy(ip_config->ifname, config_buff->ifname, INTERFACE_NAMSIZ);
|
||||||
strncpy(ip_config->ipaddr, inet_ntoa(config_buff->prefix), DOT_IP_LEN);
|
strncpy(ip_config->ipaddr, inet_ntoa(config_buff->prefix), DOT_IP_STR);
|
||||||
|
|
||||||
/* create Student JSON object */
|
/* create Student JSON object */
|
||||||
s2j_create_json_obj(json_obj);
|
s2j_create_json_obj(json_obj);
|
||||||
|
@ -260,7 +260,7 @@ ret_code ip_config_format_json_array(ip_config_t *config_buff, int count, pointe
|
||||||
ip_config->family = AF_INET;
|
ip_config->family = AF_INET;
|
||||||
ip_config->prefixlen = config_buff[i].prefixlen;
|
ip_config->prefixlen = config_buff[i].prefixlen;
|
||||||
strncpy(ip_config->ifname, config_buff[i].ifname, INTERFACE_NAMSIZ);
|
strncpy(ip_config->ifname, config_buff[i].ifname, INTERFACE_NAMSIZ);
|
||||||
strncpy(ip_config->ipaddr, inet_ntoa(config_buff[i].prefix), DOT_IP_LEN);
|
strncpy(ip_config->ipaddr, inet_ntoa(config_buff[i].prefix), DOT_IP_STR);
|
||||||
|
|
||||||
/* create Student JSON object */
|
/* create Student JSON object */
|
||||||
s2j_create_json_obj(json_obj);
|
s2j_create_json_obj(json_obj);
|
||||||
|
|
Loading…
Reference in New Issue