1 /*	$Id: armsd_miconf_private.h 20800 2012-01-19 05:13:45Z m-oki $	*/
2 
3 /*
4  * Copyright (c) 2012, Internet Initiative Japan, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef __ARMSD_MICONF_PRIVATE_H__
31 #define __ARMSD_MICONF_PRIVATE_H__
32 #include <sys/time.h>
33 #include <libarms_param.h>
34 
35 #define ACMI_DEFAULT_CONF_HANDLER acmi_load_conf_buffer
36 
37 /**
38  * ����ե�����¤�Ρ�Initial config, LS config���ˤĤ���ɬ�ס�
39  */
40 typedef struct armsd_mi_config {
41 	/* Hidden Anonymous PPPoE Configuration */
42 	char *anon_account;
43 	char *anon_password;
44 
45 	/* Hidden Anonymous Mobile Configuration */
46 	char *m_telno;
47 	char *m_cid;
48 	char *m_apn;
49 	char *m_pdp;
50 	char *m_anon_account;
51 	char *m_anon_password;
52 
53 	/* Client parameters */
54 	struct client_define {
55 		int retry_max;
56 		struct timeval retry_int;
57 		time_t lltimeout;
58 	} client_def;
59 	int have_client;
60 
61 	/* Server parameters */
62 	struct server_define {
63 		url_t server_url;
64 		int have_cert;
65 		char cacert[ARMS_MAX_PEM_LEN];
66 	} server_defs[CONF_MAX_LS_LIST];
67 	int num_server;
68 	int current_server;
69 
70 	/* Line parameters */
71 	struct line_define line_defs[CONF_MAX_LINE_LIST];
72 	int num_line;
73 	int current_line;
74 
75 } acmi_config_t;
76 
77 /**
78  *
79  */
80 typedef struct acmi_config_object {
81 	acmi_config_type_t conf_type;
82 
83 	distribution_id_t distid;
84 	char sa_desc[ARMS_MAX_DESC_LEN];
85 	char sa_version[ARMS_MAX_VER_LEN];
86 
87 	acmi_config_t mi_config[ACMI_CONFIG_NONE];
88 } acmi_config_obj_t; /* == ACMI */
89 
90 /**
91  * For text formatted config
92  */
93 extern int acmi_load_tconf_buffer(void *dst, char *src, size_t len);
94 
95 /*
96  * for binary config
97  */
98 int acmi_clear_conf_buffer(void *, int);
99 int acmi_load_conf_buffer(void *, int, char *, int, size_t);
100 
101 #endif /* __ARMSD_MICONF_PRIVATE_H__ */
102