Michael Spencer / Mbed 2 deprecated LaOS

Dependencies:   mbed

Committer:
Michael J. Spencer
Date:
Wed Mar 05 06:14:02 2014 -0800
Revision:
1:f5ac63519541
Initial commit.

Who changed what in which revision?

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