Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of libMiMic by
core/net/NyLPC_cNet.h@37:fc4b4fd6a649, 2013-06-19 (annotated)
- Committer:
- nyatla
- Date:
- Wed Jun 19 09:33:01 2013 +0000
- Revision:
- 37:fc4b4fd6a649
- Parent:
- 12:efe841863fc8
- Child:
- 69:8c5f220441f5
update; MiMic Core r263; add mDNS service,DHCP client,APIPA client
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nyatla | 37:fc4b4fd6a649 | 1 | /********************************************************************************* |
| nyatla | 37:fc4b4fd6a649 | 2 | * PROJECT: MiMic |
| nyatla | 37:fc4b4fd6a649 | 3 | * -------------------------------------------------------------------------------- |
| nyatla | 37:fc4b4fd6a649 | 4 | * |
| nyatla | 37:fc4b4fd6a649 | 5 | * This file is part of MiMic |
| nyatla | 37:fc4b4fd6a649 | 6 | * Copyright (C)2011 Ryo Iizuka |
| nyatla | 37:fc4b4fd6a649 | 7 | * |
| nyatla | 37:fc4b4fd6a649 | 8 | * MiMic is free software: you can redistribute it and/or modify |
| nyatla | 37:fc4b4fd6a649 | 9 | * it under the terms of the GNU Lesser General Public License as published |
| nyatla | 37:fc4b4fd6a649 | 10 | * by the Free Software Foundation, either version 3 of the License, or |
| nyatla | 37:fc4b4fd6a649 | 11 | * (at your option) any later version. |
| nyatla | 37:fc4b4fd6a649 | 12 | * |
| nyatla | 37:fc4b4fd6a649 | 13 | * This program is distributed in the hope that it will be useful, |
| nyatla | 37:fc4b4fd6a649 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| nyatla | 37:fc4b4fd6a649 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| nyatla | 37:fc4b4fd6a649 | 16 | * GNU General Public License for more details. |
| nyatla | 37:fc4b4fd6a649 | 17 | * |
| nyatla | 37:fc4b4fd6a649 | 18 | * You should have received a copy of the GNU Lesser General Public License |
| nyatla | 37:fc4b4fd6a649 | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| nyatla | 37:fc4b4fd6a649 | 20 | * |
| nyatla | 37:fc4b4fd6a649 | 21 | * For further information please contact. |
| nyatla | 37:fc4b4fd6a649 | 22 | * http://nyatla.jp/ |
| nyatla | 37:fc4b4fd6a649 | 23 | * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp> |
| nyatla | 37:fc4b4fd6a649 | 24 | * |
| nyatla | 37:fc4b4fd6a649 | 25 | *********************************************************************************/ |
| nyatla | 2:b96c1e90d120 | 26 | #ifndef NYLPC_CNET_H_ |
| nyatla | 2:b96c1e90d120 | 27 | #define NYLPC_CNET_H_ |
| nyatla | 2:b96c1e90d120 | 28 | |
| nyatla | 2:b96c1e90d120 | 29 | #include "NyLPC_stdlib.h" |
| nyatla | 2:b96c1e90d120 | 30 | #include "NyLPC_uipService.h" |
| nyatla | 2:b96c1e90d120 | 31 | #include "NyLPC_cNetConfig.h" |
| nyatla | 12:efe841863fc8 | 32 | #ifdef __cplusplus |
| nyatla | 12:efe841863fc8 | 33 | extern "C" { |
| nyatla | 12:efe841863fc8 | 34 | #endif /* __cplusplus */ |
| nyatla | 2:b96c1e90d120 | 35 | /** |
| nyatla | 2:b96c1e90d120 | 36 | * クラス型を定義します。 |
| nyatla | 2:b96c1e90d120 | 37 | */ |
| nyatla | 2:b96c1e90d120 | 38 | typedef struct NyLPC_TcNet NyLPC_TcNet_t; |
| nyatla | 2:b96c1e90d120 | 39 | |
| nyatla | 2:b96c1e90d120 | 40 | /** |
| nyatla | 2:b96c1e90d120 | 41 | * Platformを示す文字列 |
| nyatla | 2:b96c1e90d120 | 42 | */ |
| nyatla | 2:b96c1e90d120 | 43 | extern const char* NyLPC_cNet_PlatformName; |
| nyatla | 2:b96c1e90d120 | 44 | |
| nyatla | 2:b96c1e90d120 | 45 | |
| nyatla | 2:b96c1e90d120 | 46 | struct NyLPC_TcNet |
| nyatla | 2:b96c1e90d120 | 47 | { |
| nyatla | 2:b96c1e90d120 | 48 | int dummy; |
| nyatla | 2:b96c1e90d120 | 49 | }; |
| nyatla | 2:b96c1e90d120 | 50 | |
| nyatla | 2:b96c1e90d120 | 51 | /** |
| nyatla | 2:b96c1e90d120 | 52 | * ネットワークを初期化する。 |
| nyatla | 2:b96c1e90d120 | 53 | */ |
| nyatla | 2:b96c1e90d120 | 54 | void NyLPC_cNet_initialize(NyLPC_TcNet_t* i_inst); |
| nyatla | 3:0a94993be1f6 | 55 | |
| nyatla | 12:efe841863fc8 | 56 | #define NyLPC_cNet_finalize(inst) |
| nyatla | 2:b96c1e90d120 | 57 | /** |
| nyatla | 37:fc4b4fd6a649 | 58 | * ネットワークサービスを開始します。 |
| nyatla | 37:fc4b4fd6a649 | 59 | * サービスは停止中でなければなりません。 |
| nyatla | 2:b96c1e90d120 | 60 | * 関数は、ネットワークアダプタの値を元にNyLPC_cMiMicEnv_PlatformName変数の値を更新します。 |
| nyatla | 2:b96c1e90d120 | 61 | * @param i_ref_config |
| nyatla | 2:b96c1e90d120 | 62 | * Networkコンフィギュレーション変数。このオブジェクトはcNetをstopするまで維持すること。 |
| nyatla | 2:b96c1e90d120 | 63 | */ |
| nyatla | 2:b96c1e90d120 | 64 | void NyLPC_cNet_start(NyLPC_TcNet_t* i_inst,const NyLPC_TcNetConfig_t* i_ref_config); |
| nyatla | 37:fc4b4fd6a649 | 65 | /** |
| nyatla | 37:fc4b4fd6a649 | 66 | * ネットワークスタックを停止します。 |
| nyatla | 37:fc4b4fd6a649 | 67 | * サービスは開始中でなければなりません。 |
| nyatla | 37:fc4b4fd6a649 | 68 | * start関数で開始済である必要があります。 |
| nyatla | 37:fc4b4fd6a649 | 69 | * この関数をコールする前に、全てのTCPソケットを閉じ、非同期なソケット操作を停止してください。 |
| nyatla | 37:fc4b4fd6a649 | 70 | */ |
| nyatla | 37:fc4b4fd6a649 | 71 | void NyLPC_cNet_stop(NyLPC_TcNet_t* i_inst); |
| nyatla | 37:fc4b4fd6a649 | 72 | |
| nyatla | 37:fc4b4fd6a649 | 73 | /** |
| nyatla | 37:fc4b4fd6a649 | 74 | * NyLPC_TcIPv4Config_tをDHCPで更新します。 |
| nyatla | 37:fc4b4fd6a649 | 75 | * この関数をコールする時は、サービスは停止中でなければなりません。 |
| nyatla | 37:fc4b4fd6a649 | 76 | * @param i_cfg |
| nyatla | 37:fc4b4fd6a649 | 77 | * 更新するi_cfg構造体。 |
| nyatla | 37:fc4b4fd6a649 | 78 | * emac,default_mssは設定済である必要があります。他のフィールド値は不定で構いません。 |
| nyatla | 37:fc4b4fd6a649 | 79 | * 更新されるフィールドは、ip,netmast,default_rootの3つです。 |
| nyatla | 37:fc4b4fd6a649 | 80 | * @return |
| nyatla | 37:fc4b4fd6a649 | 81 | * 更新に成功した場合TRUE |
| nyatla | 37:fc4b4fd6a649 | 82 | */ |
| nyatla | 37:fc4b4fd6a649 | 83 | NyLPC_TBool NyLPC_cNet_requestAddrDhcp(NyLPC_TcNet_t* i_net,NyLPC_TcIPv4Config_t* i_cfg,NyLPC_TInt16 i_repeat); |
| nyatla | 2:b96c1e90d120 | 84 | |
| nyatla | 12:efe841863fc8 | 85 | #ifdef __cplusplus |
| nyatla | 12:efe841863fc8 | 86 | } |
| nyatla | 12:efe841863fc8 | 87 | #endif /* __cplusplus */ |
| nyatla | 2:b96c1e90d120 | 88 | #endif /* NYLPC_CNET_H_ */ |
