OSDN Git Service

update libMiMic
[mimic/MiMicSDK.git] / lib / src / net / httpd / mod / NyLPC_cModMiMicSetting.h
1 /*********************************************************************************\r
2  * PROJECT: MiMic\r
3  * --------------------------------------------------------------------------------\r
4  *\r
5  * This file is part of MiMic\r
6  * Copyright (C)2011 Ryo Iizuka\r
7  *\r
8  * MiMic is free software: you can redistribute it and/or modify\r
9  * it under the terms of the GNU Lesser General Public License as published\r
10  * by the Free Software Foundation, either version 3 of the License, or\r
11  * (at your option) any later version.\r
12  *\r
13  * This program is distributed in the hope that it will be useful,\r
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
16  * GNU General Public License for more details.\r
17  *\r
18  * You should have received a copy of the GNU Lesser General Public License\r
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
20  *\r
21  * For further information please contact.\r
22  *  http://nyatla.jp/\r
23  *  <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
24  *\r
25  *********************************************************************************/\r
26 #ifndef NYLPC_CMODMIMICSETTING_H_\r
27 #define NYLPC_CMODMIMICSETTING_H_\r
28 #include "NyLPC_http.h"\r
29 #include "../NyLPC_cHttpdConnection.h"\r
30 #include "NyLPC_cModRomFiles.h"\r
31 #ifdef __cplusplus\r
32 extern "C" {\r
33 #endif /* __cplusplus */\r
34 \r
35 /**\r
36  * MiMicの動作設定CGIです。MiMicの設定値をオンチップフラッシュへ保存/読み出しします。\r
37  * uipServiceはNyLPC_TcNetConfig_tを継承したインスタンスで初期化してください。\r
38  *\r
39  * JSONAPIとして、以下のAPIを提供します。\r
40  * ./setup.api?c=[update|get]&p=[:param:]\r
41  * MiMicの動作設定と取得を行います。\r
42  * c=get 現在の状態をjson形式で返却する。\r
43  * {\r
44  *      application: [:string:],\r
45  *      mac00010203: [:HEX32:],\r
46  *      mac0405xxxx: [:HEX32:],\r
47  *      ip: [:HEX32:],\r
48  *      mask: [:HEX32:],\r
49  *      droute: [:HEX32:],\r
50  *\r
51  *      port: [:HEX16:],\r
52  *      access\":%u}",\r
53  * c=update pパラメタ/hostの内容でFlashをアップデートする。\r
54  *      pパラメタは32bitの16進数文字列。\r
55  *      [ 0] emac_0123      ビックエンディアン48bit値+パディング16bit\r
56  *      [ 1] emac_45xx      :\r
57  *          [emac4][emac5][x][x]\r
58  *      [ 2] ipv4_flags     IPV4設定フラグ\r
59  *      [ 3] ipv4_ip        IPアドレス。32bit値。ビックエンディアン\r
60  *      [ 4] ipv4_mask      サブネットマスク。32bit値。ビックエンディアン\r
61  *      [ 5] ipv4_deoute    defaultrootアドレス。32bit値。ビックエンディアン\r
62  *      [ 6] service_flag\r
63  *          See NyLPC_cNetConfig.h\r
64  *      [ 7] http_param     HTTPサービスポート番号。2桁のHEX値である。ビックエンディアン。値16bit、パディング16bit\r
65  *          [port_h][port_l][x][x]\r
66  */\r
67 typedef struct NyLPC_TcModMiMicSetting NyLPC_TcModMiMicSetting_t;\r
68 \r
69 \r
70 struct NyLPC_TcModMiMicSetting\r
71 {\r
72     NyLPC_TcModRomFiles_t super;\r
73 };\r
74 \r
75 /**\r
76  * コンストラクタ。\r
77  */\r
78 void NyLPC_cModMiMicSetting_initialize(NyLPC_TcModMiMicSetting_t* i_inst,const NyLPC_TChar* i_ref_root_path);\r
79 void NyLPC_cModMiMicSetting_finalize(NyLPC_TcModMiMicSetting_t* i_inst);\r
80 \r
81 /**\r
82  * モジュールがコネクションをハンドリングできるかを返します。\r
83  */\r
84 NyLPC_TBool NyLPC_cModMiMicSetting_canHandle(NyLPC_TcModMiMicSetting_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
85 /**\r
86  * モジュールを実行します。\r
87  * @return 処理に成功したか\r
88  */\r
89 NyLPC_TBool NyLPC_cModMiMicSetting_execute(NyLPC_TcModMiMicSetting_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
90 \r
91 \r
92 #ifdef __cplusplus\r
93 }\r
94 #endif /* __cplusplus */\r
95 \r
96 #endif /* NYLPC_CHTTPSHORTHTTPHEADERPARSER_H_ */\r