![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
LPC1768/if/lwip/LwipNetIf.h@0:cd4c47744fa1, 2011-09-06 (annotated)
- Committer:
- slowness
- Date:
- Tue Sep 06 18:10:36 2011 +0000
- Revision:
- 0:cd4c47744fa1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
slowness | 0:cd4c47744fa1 | 1 | |
slowness | 0:cd4c47744fa1 | 2 | /* |
slowness | 0:cd4c47744fa1 | 3 | Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com) |
slowness | 0:cd4c47744fa1 | 4 | |
slowness | 0:cd4c47744fa1 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy |
slowness | 0:cd4c47744fa1 | 6 | of this software and associated documentation files (the "Software"), to deal |
slowness | 0:cd4c47744fa1 | 7 | in the Software without restriction, including without limitation the rights |
slowness | 0:cd4c47744fa1 | 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
slowness | 0:cd4c47744fa1 | 9 | copies of the Software, and to permit persons to whom the Software is |
slowness | 0:cd4c47744fa1 | 10 | furnished to do so, subject to the following conditions: |
slowness | 0:cd4c47744fa1 | 11 | |
slowness | 0:cd4c47744fa1 | 12 | The above copyright notice and this permission notice shall be included in |
slowness | 0:cd4c47744fa1 | 13 | all copies or substantial portions of the Software. |
slowness | 0:cd4c47744fa1 | 14 | |
slowness | 0:cd4c47744fa1 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
slowness | 0:cd4c47744fa1 | 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
slowness | 0:cd4c47744fa1 | 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
slowness | 0:cd4c47744fa1 | 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
slowness | 0:cd4c47744fa1 | 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
slowness | 0:cd4c47744fa1 | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
slowness | 0:cd4c47744fa1 | 21 | THE SOFTWARE. |
slowness | 0:cd4c47744fa1 | 22 | */ |
slowness | 0:cd4c47744fa1 | 23 | |
slowness | 0:cd4c47744fa1 | 24 | #ifndef LWIPNETIF_H |
slowness | 0:cd4c47744fa1 | 25 | #define LWIPNETIF_H |
slowness | 0:cd4c47744fa1 | 26 | |
slowness | 0:cd4c47744fa1 | 27 | //class Ticker; |
slowness | 0:cd4c47744fa1 | 28 | #include "mbed.h" |
slowness | 0:cd4c47744fa1 | 29 | |
slowness | 0:cd4c47744fa1 | 30 | #define NET_LWIP_STACK 1 |
slowness | 0:cd4c47744fa1 | 31 | #include "core/net.h" |
slowness | 0:cd4c47744fa1 | 32 | #include "if/net/netif.h" |
slowness | 0:cd4c47744fa1 | 33 | /* |
slowness | 0:cd4c47744fa1 | 34 | #include "lwipNetTcpSocket.h" |
slowness | 0:cd4c47744fa1 | 35 | #include "lwipNetUdpSocket.h" |
slowness | 0:cd4c47744fa1 | 36 | #include "lwipNetDnsRequest.h" |
slowness | 0:cd4c47744fa1 | 37 | */ |
slowness | 0:cd4c47744fa1 | 38 | |
slowness | 0:cd4c47744fa1 | 39 | class LwipNetIf : public NetIf |
slowness | 0:cd4c47744fa1 | 40 | { |
slowness | 0:cd4c47744fa1 | 41 | public: |
slowness | 0:cd4c47744fa1 | 42 | LwipNetIf(); |
slowness | 0:cd4c47744fa1 | 43 | virtual ~LwipNetIf(); |
slowness | 0:cd4c47744fa1 | 44 | |
slowness | 0:cd4c47744fa1 | 45 | void init(); |
slowness | 0:cd4c47744fa1 | 46 | |
slowness | 0:cd4c47744fa1 | 47 | virtual NetTcpSocket* tcpSocket(); //Create a new tcp socket |
slowness | 0:cd4c47744fa1 | 48 | virtual NetUdpSocket* udpSocket(); //Create a new udp socket |
slowness | 0:cd4c47744fa1 | 49 | virtual NetDnsRequest* dnsRequest(const char* hostname); //Create a new NetDnsRequest object |
slowness | 0:cd4c47744fa1 | 50 | virtual NetDnsRequest* dnsRequest(Host* pHost); //Create a new NetDnsRequest object |
slowness | 0:cd4c47744fa1 | 51 | |
slowness | 0:cd4c47744fa1 | 52 | virtual void poll(); |
slowness | 0:cd4c47744fa1 | 53 | |
slowness | 0:cd4c47744fa1 | 54 | private: |
slowness | 0:cd4c47744fa1 | 55 | Timer m_tcpTimer; |
slowness | 0:cd4c47744fa1 | 56 | Timer m_dnsTimer; |
slowness | 0:cd4c47744fa1 | 57 | |
slowness | 0:cd4c47744fa1 | 58 | bool m_init; |
slowness | 0:cd4c47744fa1 | 59 | |
slowness | 0:cd4c47744fa1 | 60 | }; |
slowness | 0:cd4c47744fa1 | 61 | |
slowness | 0:cd4c47744fa1 | 62 | #endif |