2019-07-02 07:04:25 +00:00
|
|
|
|
#ifndef LOCALPORTAL_H_
|
|
|
|
|
#define LOCALPORTAL_H_
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
#include <net/if.h>
|
|
|
|
|
#include "../../../../common/rpc/rpc_common.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*配置消息 */
|
|
|
|
|
typedef struct {
|
|
|
|
|
uint32_t ip;
|
|
|
|
|
int port;
|
|
|
|
|
}localportal_configure_t;
|
|
|
|
|
|
|
|
|
|
/*全局变量初始化 失败为1 成功为0*/
|
2019-07-19 08:21:16 +00:00
|
|
|
|
int localportalInit(localportal_configure_t **localportal);
|
2019-07-02 07:04:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*检查IP地址是否有效,端口号是否被占用 */
|
|
|
|
|
int _valid_ipv4_port(const char *str, int port);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*判断配置本地Portal服务器的IP地址是否有效,端口号是否被占用 */
|
2019-07-06 06:27:30 +00:00
|
|
|
|
ret_code portalserver_config_chk(uint source, uint *config_type,
|
|
|
|
|
pointer input, int *input_len,
|
2019-07-02 07:04:25 +00:00
|
|
|
|
pointer output, int *output_len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*系统管理模块将数据内容(IP地址、端口号)发送给web server */
|
2019-07-02 11:48:55 +00:00
|
|
|
|
ret_code portalserver_config_proc(uint source, uint config_type,
|
2019-07-02 07:04:25 +00:00
|
|
|
|
pointer input, int input_len,
|
|
|
|
|
pointer output, int *output_len);
|
|
|
|
|
|
|
|
|
|
#endif
|