1 |
/*********************************************************************
|
2 |
*
|
3 |
* ICMP Module Defs for Microchip TCP/IP Stack
|
4 |
*
|
5 |
*********************************************************************
|
6 |
* FileName: ICMP.h
|
7 |
* Dependencies: StackTsk.h
|
8 |
* IP.h
|
9 |
* MAC.h
|
10 |
* Processor: PIC18
|
11 |
* Complier: MCC18 v1.00.50 or higher
|
12 |
* HITECH PICC-18 V8.10PL1 or higher
|
13 |
* Company: Microchip Technology, Inc.
|
14 |
*
|
15 |
* Software License Agreement
|
16 |
*
|
17 |
* The software supplied herewith by Microchip Technology Incorporated
|
18 |
* (the “Company”) for its PICmicro® Microcontroller is intended and
|
19 |
* supplied to you, the Company’s customer, for use solely and
|
20 |
* exclusively on Microchip PICmicro Microcontroller products. The
|
21 |
* software is owned by the Company and/or its supplier, and is
|
22 |
* protected under applicable copyright laws. All rights are reserved.
|
23 |
* Any use in violation of the foregoing restrictions may subject the
|
24 |
* user to criminal sanctions under applicable laws, as well as to
|
25 |
* civil liability for the breach of the terms and conditions of this
|
26 |
* license.
|
27 |
*
|
28 |
* THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
|
29 |
* WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
|
30 |
* TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
31 |
* PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
|
32 |
* IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
|
33 |
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
34 |
*
|
35 |
* Author Date Comment
|
36 |
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
37 |
* Nilesh Rajbharti 4/27/01 Original (Rev 1.0)
|
38 |
* Nilesh Rajbharti 5/22/02 Rev 2.0 (See version.log for detail)
|
39 |
********************************************************************/
|
40 |
|
41 |
#ifndef ICMP_H
|
42 |
#define ICMP_H
|
43 |
|
44 |
#include "stacktsk.h"
|
45 |
#include "ip.h"
|
46 |
#include "mac.h"
|
47 |
|
48 |
typedef enum _ICMP_CODE
|
49 |
{
|
50 |
ICMP_ECHO_REPLY = 0,
|
51 |
ICMP_ECHO_REQUEST = 8
|
52 |
} ICMP_CODE, ICMP_REQUESTS;
|
53 |
|
54 |
|
55 |
/*********************************************************************
|
56 |
* Function: BOOL ICMPIsTxReady()
|
57 |
*
|
58 |
* PreCondition: None
|
59 |
*
|
60 |
* Input: None
|
61 |
*
|
62 |
* Output: TRUE if transmit buffer is ready
|
63 |
* FALSE if transmit buffer is not ready
|
64 |
*
|
65 |
* Side Effects: None
|
66 |
*
|
67 |
* Note: None
|
68 |
*
|
69 |
********************************************************************/
|
70 |
#define ICMPIsTxReady() MACIsTxReady()
|
71 |
|
72 |
|
73 |
/*********************************************************************
|
74 |
* Function: void ICMPPut(NODE_INFO *remote,
|
75 |
* ICMP_CODE code,
|
76 |
* BYTE *data,
|
77 |
* BYTE len,
|
78 |
* WORD id,
|
79 |
* WORD seq)
|
80 |
*
|
81 |
* PreCondition: ICMPIsTxReady() == TRUE
|
82 |
*
|
83 |
* Input: remote - Remote node info
|
84 |
* code - ICMP_ECHO_REPLY or ICMP_ECHO_REQUEST
|
85 |
* data - Data bytes
|
86 |
* len - Number of bytes to send
|
87 |
* id - ICMP identifier
|
88 |
* seq - ICMP sequence number
|
89 |
*
|
90 |
* Output: None
|
91 |
*
|
92 |
* Side Effects: None
|
93 |
*
|
94 |
* Note: A ICMP packet is created and put on MAC.
|
95 |
*
|
96 |
********************************************************************/
|
97 |
void ICMPPut(NODE_INFO *remote,
|
98 |
ICMP_CODE code,
|
99 |
BYTE *data,
|
100 |
BYTE len,
|
101 |
WORD id,
|
102 |
WORD seq);
|
103 |
|
104 |
|
105 |
/*********************************************************************
|
106 |
* Function: BOOL ICMPGet(ICMP_CODE *code,
|
107 |
* BYTE *data,
|
108 |
* BYTE *len,
|
109 |
* WORD *id,
|
110 |
* WORD *seq)
|
111 |
*
|
112 |
* PreCondition: MAC buffer contains ICMP type packet.
|
113 |
*
|
114 |
* Input: code - Buffer to hold ICMP code value
|
115 |
* data - Buffer to hold ICMP data
|
116 |
* len - Buffer to hold ICMP data length
|
117 |
* id - Buffer to hold ICMP id
|
118 |
* seq - Buffer to hold ICMP seq
|
119 |
*
|
120 |
* Output: TRUE if valid ICMP packet was received
|
121 |
* FALSE otherwise.
|
122 |
*
|
123 |
* Side Effects: None
|
124 |
*
|
125 |
* Overview: None
|
126 |
*
|
127 |
* Note: None
|
128 |
********************************************************************/
|
129 |
BOOL ICMPGet(ICMP_CODE *code,
|
130 |
BYTE *data,
|
131 |
BYTE *len,
|
132 |
WORD *id,
|
133 |
WORD *seq);
|
134 |
|
135 |
|
136 |
|
137 |
#endif
|
138 |
|
139 |
|