Core networking libraries including LwIP implementation
Dependencies: DebugLib lwip_ppp_ethernet
Dependents: EthernetNetworkLib
main/if/IPInterface.cpp@4:e60b65fed967, 2012-05-31 (annotated)
- Committer:
- donatien
- Date:
- Thu May 31 15:09:06 2012 +0000
- Revision:
- 4:e60b65fed967
- Parent:
- 1:240e3322b87a
Debuglib up
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 1:240e3322b87a | 1 | /* IPInterface.cpp */ |
donatien | 1:240e3322b87a | 2 | /* |
donatien | 1:240e3322b87a | 3 | Copyright (C) 2012 ARM Limited. |
donatien | 1:240e3322b87a | 4 | |
donatien | 1:240e3322b87a | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of |
donatien | 1:240e3322b87a | 6 | this software and associated documentation files (the "Software"), to deal in |
donatien | 1:240e3322b87a | 7 | the Software without restriction, including without limitation the rights to |
donatien | 1:240e3322b87a | 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
donatien | 1:240e3322b87a | 9 | of the Software, and to permit persons to whom the Software is furnished to do |
donatien | 1:240e3322b87a | 10 | so, subject to the following conditions: |
donatien | 1:240e3322b87a | 11 | |
donatien | 1:240e3322b87a | 12 | The above copyright notice and this permission notice shall be included in all |
donatien | 1:240e3322b87a | 13 | copies or substantial portions of the Software. |
donatien | 1:240e3322b87a | 14 | |
donatien | 1:240e3322b87a | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
donatien | 1:240e3322b87a | 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
donatien | 1:240e3322b87a | 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
donatien | 1:240e3322b87a | 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
donatien | 1:240e3322b87a | 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
donatien | 1:240e3322b87a | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
donatien | 1:240e3322b87a | 21 | SOFTWARE. |
donatien | 1:240e3322b87a | 22 | */ |
donatien | 1:240e3322b87a | 23 | |
donatien | 1:240e3322b87a | 24 | #include "core/fwk.h" |
donatien | 1:240e3322b87a | 25 | |
donatien | 1:240e3322b87a | 26 | #include "IPInterface.h" |
donatien | 1:240e3322b87a | 27 | |
donatien | 1:240e3322b87a | 28 | |
donatien | 1:240e3322b87a | 29 | IPInterface::IPInterface() |
donatien | 1:240e3322b87a | 30 | { |
donatien | 1:240e3322b87a | 31 | |
donatien | 1:240e3322b87a | 32 | } |
donatien | 1:240e3322b87a | 33 | |
donatien | 1:240e3322b87a | 34 | /*virtual*/ IPInterface::~IPInterface() |
donatien | 1:240e3322b87a | 35 | { |
donatien | 1:240e3322b87a | 36 | |
donatien | 1:240e3322b87a | 37 | } |
donatien | 1:240e3322b87a | 38 | |
donatien | 1:240e3322b87a | 39 | void IPInterface::registerAsDefaultInterface() //First come, first served |
donatien | 1:240e3322b87a | 40 | { |
donatien | 1:240e3322b87a | 41 | s_pDefaultInterface = this; |
donatien | 1:240e3322b87a | 42 | } |
donatien | 1:240e3322b87a | 43 | |
donatien | 1:240e3322b87a | 44 | void IPInterface::unregisterAsDefaultInterface() //Must be called before inst is destroyed to avoid invalid ptr fault |
donatien | 1:240e3322b87a | 45 | { |
donatien | 1:240e3322b87a | 46 | s_pDefaultInterface = NULL; |
donatien | 1:240e3322b87a | 47 | } |
donatien | 1:240e3322b87a | 48 | |
donatien | 1:240e3322b87a | 49 | /*static*/ IPInterface* IPInterface::getDefaultInterface() //For use by TCP, UDP sockets library |
donatien | 1:240e3322b87a | 50 | { |
donatien | 1:240e3322b87a | 51 | return s_pDefaultInterface; |
donatien | 1:240e3322b87a | 52 | } |
donatien | 1:240e3322b87a | 53 | |
donatien | 1:240e3322b87a | 54 | /*static*/ IPInterface* IPInterface::s_pDefaultInterface = NULL; |