Committer:
zoot661
Date:
Tue May 29 09:49:18 2012 +0000
Revision:
0:f993b6d8b1d8

        

Who changed what in which revision?

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