Line No. | Rev | Author | Line |
---|---|---|---|
1 | 32 | kaklik | /********************************************************************* |
2 | * |
||
3 | * Microchip TCP/IP Stack Definitions |
||
4 | * |
||
5 | ********************************************************************* |
||
6 | * FileName: StackTsk.h |
||
7 | * Dependencies: Compiler.h |
||
8 | * Processor: PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F, PIC32 |
||
9 | * Compiler: Microchip C32 v1.05 or higher |
||
10 | * Microchip C30 v3.12 or higher |
||
11 | * Microchip C18 v3.30 or higher |
||
12 | * HI-TECH PICC-18 PRO 9.63PL2 or higher |
||
13 | * Company: Microchip Technology, Inc. |
||
14 | * |
||
15 | * Software License Agreement |
||
16 | * |
||
17 | * Copyright (C) 2002-2009 Microchip Technology Inc. All rights |
||
18 | * reserved. |
||
19 | * |
||
20 | * Microchip licenses to you the right to use, modify, copy, and |
||
21 | * distribute: |
||
22 | * (i) the Software when embedded on a Microchip microcontroller or |
||
23 | * digital signal controller product ("Device") which is |
||
24 | * integrated into Licensee's product; or |
||
25 | * (ii) ONLY the Software driver source files ENC28J60.c, ENC28J60.h, |
||
26 | * ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device |
||
27 | * used in conjunction with a Microchip ethernet controller for |
||
28 | * the sole purpose of interfacing with the ethernet controller. |
||
29 | * |
||
30 | * You should refer to the license agreement accompanying this |
||
31 | * Software for additional information regarding your rights and |
||
32 | * obligations. |
||
33 | * |
||
34 | * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT |
||
35 | * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT |
||
36 | * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A |
||
37 | * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
||
38 | * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR |
||
39 | * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF |
||
40 | * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS |
||
41 | * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE |
||
42 | * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER |
||
43 | * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT |
||
44 | * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE. |
||
45 | * |
||
46 | * |
||
47 | * Author Date Comment |
||
48 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
49 | * Nilesh Rajbharti 8/10/01 Original (Rev 1.0) |
||
50 | * Nilesh Rajbharti 2/9/02 Cleanup |
||
51 | * Nilesh Rajbharti 5/22/02 Rev 2.0 (See version.log for detail) |
||
52 | * Nilesh Rajbharti 8/7/03 Rev 2.21 - TFTP Client addition |
||
53 | * Howard Schlunder 9/30/04 Added MCHP_MAC, MAC_POWER_ON_TEST, |
||
54 | EEPROM_BUFFER_SIZE, USE_LCD |
||
55 | * Howard Schlunder 8/09/06 Removed MCHP_MAC, added STACK_USE_NBNS, |
||
56 | * STACK_USE_DNS, and STACK_USE_GENERIC_TCP_EXAMPLE |
||
57 | ********************************************************************/ |
||
58 | #ifndef __STACK_TSK_H |
||
59 | #define __STACK_TSK_H |
||
60 | |||
61 | #if defined (WF_CS_TRIS) |
||
62 | #include "WF_Config.h" // pull in additional defines from wireless settings |
||
63 | #endif |
||
64 | |||
65 | // Check for potential configuration errors in "TCPIPConfig.h" |
||
66 | #if (MAX_UDP_SOCKETS <= 0 || MAX_UDP_SOCKETS > 255 ) |
||
67 | #error Invalid MAX_UDP_SOCKETS value specified |
||
68 | #endif |
||
69 | |||
70 | // Check for potential configuration errors in "TCPIPConfig.h" |
||
71 | #if (MAX_HTTP_CONNECTIONS <= 0 || MAX_HTTP_CONNECTIONS > 255 ) |
||
72 | #error Invalid MAX_HTTP_CONNECTIONS value specified. |
||
73 | #endif |
||
74 | |||
75 | // Structure to contain a MAC address |
||
76 | typedef struct __attribute__((__packed__)) |
||
77 | { |
||
78 | BYTE v[6]; |
||
79 | } MAC_ADDR; |
||
80 | |||
81 | // Definition to represent an IP address |
||
82 | #define IP_ADDR DWORD_VAL |
||
83 | |||
84 | // Address structure for a node |
||
85 | typedef struct __attribute__((__packed__)) |
||
86 | { |
||
87 | IP_ADDR IPAddr; |
||
88 | MAC_ADDR MACAddr; |
||
89 | } NODE_INFO; |
||
90 | |||
91 | // Application-dependent structure used to contain address information |
||
92 | typedef struct __attribute__((__packed__)) |
||
93 | { |
||
94 | IP_ADDR MyIPAddr; // IP address |
||
95 | IP_ADDR MyMask; // Subnet mask |
||
96 | IP_ADDR MyGateway; // Default Gateway |
||
97 | IP_ADDR PrimaryDNSServer; // Primary DNS Server |
||
98 | IP_ADDR SecondaryDNSServer; // Secondary DNS Server |
||
99 | IP_ADDR DefaultIPAddr; // Default IP address |
||
100 | IP_ADDR DefaultMask; // Default subnet mask |
||
101 | BYTE NetBIOSName[16]; // NetBIOS name |
||
102 | struct |
||
103 | { |
||
104 | unsigned char : 6; |
||
105 | unsigned char bIsDHCPEnabled : 1; |
||
106 | unsigned char bInConfigMode : 1; |
||
107 | } Flags; // Flag structure |
||
108 | MAC_ADDR MyMACAddr; // Application MAC address |
||
109 | |||
110 | #if defined(WF_CS_TRIS) |
||
111 | BYTE MySSID[32]; // Wireless SSID (if using MRF24WB0M) |
||
112 | BYTE SsidLength; // number of bytes in SSID |
||
113 | BYTE SecurityMode; // WF_SECURITY_OPEN or one of the other security modes |
||
114 | BYTE SecurityKey[64]; // WiFi Security key, or passphrase. |
||
115 | BYTE SecurityKeyLength; // number of bytes in security key (can be 0) |
||
116 | BYTE WepKeyIndex; // WEP key index (only valid for WEP) |
||
117 | #if defined(EZ_CONFIG_STORE) // WLAN configuration data stored to NVM |
||
118 | BYTE dataValid; |
||
119 | BYTE networkType; |
||
120 | BYTE saveSecurityInfo; // Save 32-byte PSK |
||
121 | #endif |
||
122 | #endif |
||
123 | |||
124 | #if defined(STACK_USE_SNMP_SERVER) |
||
125 | // SNMPv2C Read community names |
||
126 | // SNMP_COMMUNITY_MAX_LEN (8) + 1 null termination byte |
||
127 | BYTE readCommunity[SNMP_MAX_COMMUNITY_SUPPORT][SNMP_COMMUNITY_MAX_LEN+1]; |
||
128 | |||
129 | // SNMPv2C Write community names |
||
130 | // SNMP_COMMUNITY_MAX_LEN (8) + 1 null termination byte |
||
131 | BYTE writeCommunity[SNMP_MAX_COMMUNITY_SUPPORT][SNMP_COMMUNITY_MAX_LEN+1]; |
||
132 | #endif |
||
133 | |||
134 | } APP_CONFIG; |
||
135 | |||
136 | #ifndef THIS_IS_STACK_APPLICATION |
||
137 | extern APP_CONFIG AppConfig; |
||
138 | #endif |
||
139 | |||
140 | |||
141 | void StackInit(void); |
||
142 | void StackTask(void); |
||
143 | void StackApplications(void); |
||
144 | |||
145 | #endif |
Powered by WebSVN v2.8.3