メイン Tools: QualNet Analyzer & QualNet Packet Tracer プロトコルの書き方について | 投稿するにはまず登録を |
題名 | 投稿者 | 日時 |
---|---|---|
プロトコルの書き方について | kento | 2006/10/11 21:06 |
» Re: プロトコルの書き方について | mast | 2006/10/12 0:04 |
Re: プロトコルの書き方について | kento | 2006/10/12 6:50 |
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
mast | 投稿日時: 2006/10/12 0:04 |
一人前 登録日: 2005/4/7 居住地: 投稿: 93 |
Re: プロトコルの書き方について プログラマーズガイドのAdding a Transport Layer Protocolという節に以下の手順が書いてあるので、まずはこれらを1つずつ実行していって、行き詰ったところでその箇所について議論を進めてみては如何でしょうか?でないと、、、質問が漠としすぎてるので、たぶん誰も教えてくれないか、良くて「RTFM!」と言われるだけかと思いますたぶん。
1. Create header and source files. 2. Modify the file transport.cpp to include the protocol's header file. 3. Include the protocol in the list of Transport Layer protocols and trace protocols. 4. Define data structures for the protocl. 5. Decide on the format for the protocol-specific configuration parameters. 6. Read the protocol's configuration parameters and call the protocol's initialization function from the Transport Layer initialization function, TRANSPORT_Initialize. 7. Write the initialization function for the protocol. The initialization function should include the following tasks: a. Declare and initialize the state variables. b. Initialize timers. 8. Call the protocol event dispatcher from the Transport Layer event dispatcher, TRANSPORT_ProcessEvent. 9. Declare any new event types used by the protocol in the header file QUALNET_HOME/include/api.h. 10. Write the protocol event dispatcher. 11. Integrate the protocol with the Network Layer. a. Define an IP Protocol Number for the protocol. b. Write a function to deliver packets from IP to the protocol. c. Call the function to deliver packets from IP to the protocol from the IP function DeliverPacket. 12. Include code in various functions to collect statistics. a. Declare statistics variables. b. Initialize the statistics variables in the protocol's initialization function. c. Update the statistics as appropriate. d. Write a function to print the statistics. 13. Call the protocol finalization function from the Transport Layer finalization function, TRANSPORT_Finalize. 14. Write the protocol finalization function. Call the function to print statistics from the protocol finalization function. 15. Include the protocol header and source files in the QualNet tree and compile. |
フラット表示 | 前のトピック | 次のトピック |