1 /*********************************************************************************
\r
3 * --------------------------------------------------------------------------------
\r
5 * This file is part of MiMic
\r
6 * Copyright (C)2011 Ryo Iizuka
\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
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
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
21 * For further information please contact.
\r
23 * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
\r
26 * Parts of this file were leveraged from uIP:
\r
28 * Copyright (c) 2001-2003, Adam Dunkels.
\r
29 * All rights reserved.
\r
31 * Redistribution and use in source and binary forms, with or without
\r
32 * modification, are permitted provided that the following conditions
\r
34 * 1. Redistributions of source code must retain the above copyright
\r
35 * notice, this list of conditions and the following disclaimer.
\r
36 * 2. Redistributions in binary form must reproduce the above copyright
\r
37 * notice, this list of conditions and the following disclaimer in the
\r
38 * documentation and/or other materials provided with the distribution.
\r
39 * 3. The name of the author may not be used to endorse or promote
\r
40 * products derived from this software without specific prior
\r
41 * written permission.
\r
43 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
\r
44 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
\r
45 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
\r
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
\r
47 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
\r
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
\r
49 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
\r
50 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
\r
51 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
52 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
\r
53 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
55 #ifndef NyLPC_TcUipService_H_
\r
56 #define NyLPC_TcUipService_H_
\r
59 /**********************************************************************
\r
61 **********************************************************************/
\r
63 #include "NyLPC_cTcpSocket.h"
\r
64 #include "NyLPC_cTcpListener.h"
\r
65 #include "NyLPC_cIPv4IComp.h"
\r
66 #include "NyLPC_cIPv4Arp.h"
\r
67 #include "NyLPC_cIPv4.h"
\r
71 #endif /* __cplusplus */
\r
73 /**********************************************************************
\r
75 * NyLPC_TcUipService class
\r
77 **********************************************************************/
\r
79 * uipタスクを管理する、サービスクラスです。
\r
81 typedef struct NyLPC_TcUipService NyLPC_TcUipService_t;
\r
87 * mbedのExportしたのをLPCXpressoでコンパイルするときは+192しないと落ちる。
\r
89 #ifndef NyLPC_cUipService_config_STACK_SIZE
\r
90 #define NyLPC_cUipService_config_STACK_SIZE (256+192+192)
\r
98 * システムで唯一のUIPサービスを初期化します。1度だけ実行できます。
\r
100 NyLPC_TBool NyLPC_cUipService_initialize(void);
\r
104 * この関数はリエントラントではありません。複数のタスクから共有するときには、排他ロックを掛けてください。
\r
105 * @param i_ref_config
\r
106 * このコンフィギュレーションは、stopを実行するまでの間、インスタンスから参照します。外部で保持してください。
\r
108 void NyLPC_cUipService_start(const NyLPC_TcIPv4Config_t* i_ref_config);
\r
112 * この関数はリエントラントではありません。複数のタスクから共有するときには、排他ロックを掛けてください。
\r
113 * 関数を使用する前に、全ての非同期ソケット操作を停止してください。
\r
115 void NyLPC_cUipService_stop(void);
\r
118 * イーサネットデバイスの名前を返します。
\r
119 * この関数は、サービスが開始されているときのみ、動作します。
\r
121 const char* NyLPC_cUipService_refDeviceName(void);
\r
122 const NyLPC_TcIPv4Config_t* NyLPC_cUipService_refCurrentConfig(void);
\r
126 #endif /* __cplusplus */
\r