Line No. | Rev | Author | Line |
---|---|---|---|
1 | 6 | kaklik | /*! \file ip.h \brief IP (Internet Protocol) Library. */ |
2 | //***************************************************************************** |
||
3 | // |
||
4 | // File Name : 'ip.h' |
||
5 | // Title : IP (Internet Protocol) Library |
||
6 | // Author : Pascal Stang |
||
7 | // Created : 8/30/2004 |
||
8 | // Revised : 7/3/2005 |
||
9 | // Version : 0.1 |
||
10 | // Target MCU : Atmel AVR series |
||
11 | // Editor Tabs : 4 |
||
12 | // |
||
13 | /// \ingroup network |
||
14 | /// \defgroup ip IP (Internet Protocol) Library (ip.c) |
||
15 | /// \code #include "net/ip.h" \endcode |
||
16 | /// \par Description |
||
17 | /// The IP (Internet Protocol) library provide support for sending IP and |
||
18 | /// IP-related packets. It's not clear if additional features are needed |
||
19 | /// or will be added, or even if this is the proper way to facilitate IP |
||
20 | /// packet operations. |
||
21 | // |
||
22 | // This code is distributed under the GNU Public License |
||
23 | // which can be found at http://www.gnu.org/licenses/gpl.txt |
||
24 | //***************************************************************************** |
||
25 | //@{ |
||
26 | |||
27 | #ifndef IP_H |
||
28 | #define IP_H |
||
29 | |||
30 | #include "net.h" |
||
31 | #include "arp.h" |
||
32 | |||
33 | #include <inttypes.h> |
||
34 | |||
35 | struct ipConfig ///< IP addressing/configuration structure |
||
36 | { |
||
37 | uint32_t ip; ///< IP address |
||
38 | uint32_t netmask; ///< netmask |
||
39 | uint32_t gateway; ///< gateway IP address |
||
40 | }; |
||
41 | |||
42 | #define IP_TIME_TO_LIVE 128 ///< default Time-To-Live (TTL) value to use in IP headers |
||
43 | |||
44 | //! Set our IP address and routing information. |
||
45 | /// The myIp value will be used in the source field of IP packets. |
||
46 | /// Use this function to set and reset the system IP address. |
||
47 | void ipSetConfig(uint32_t myIp, uint32_t netmask, uint32_t gatewayIp); |
||
48 | |||
49 | //! Get our local IP address. |
||
50 | /// Returns current IP address value. |
||
51 | //uint32_t ipGetMyAddress(void); |
||
52 | |||
53 | //! Get our local IP configuration. |
||
54 | /// Returns pointer to current IP address/configuration. |
||
55 | struct ipConfig* ipGetConfig(void); |
||
56 | |||
57 | //! Print IP configuration |
||
58 | /// |
||
59 | void ipPrintConfig(struct ipConfig* config); |
||
60 | |||
61 | |||
62 | //! Send an IP packet. |
||
63 | void ipSend(uint32_t dstIp, uint8_t protocol, uint16_t len, uint8_t* data); |
||
64 | |||
65 | //! Send a UDP/IP packet. |
||
66 | void udpSend(uint32_t dstIp, uint16_t dstPort, uint16_t len, uint8_t* data); |
||
67 | |||
68 | #endif |
||
69 | //@} |
||
70 |
Powered by WebSVN v2.8.3