WORKS

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SocketAddr.h Source File

SocketAddr.h

00001 /*
00002  * PackageLicenseDeclared: Apache-2.0
00003  * Copyright (c) 2015 ARM Limited
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 #ifndef __MBED_NET_SOCKETS_V0_SOCKETADDR_H__
00018 #define __MBED_NET_SOCKETS_V0_SOCKETADDR_H__
00019 
00020 #include "sal/socket_types.h"
00021 
00022 namespace mbed {
00023 namespace Sockets {
00024 namespace v0 {
00025 
00026 class SocketAddr {
00027 public:
00028     struct socket_addr * getAddr() {return &_addr;}
00029     const struct socket_addr * getAddr() const {return &_addr;}
00030     void setAddr(const struct socket_addr *addr);
00031     void setAddr(const SocketAddr *addr);
00032     size_t getAddrSize() const {return sizeof(_addr.ipv6be);}
00033     bool is_v4();
00034 
00035     int fmtIPv4(char *buf, size_t size);
00036     int fmtIPv6(char *buf, size_t size);
00037 protected:
00038     struct socket_addr _addr;
00039 };
00040 } // namespace v0
00041 } // namespace Sockets
00042 } // namespace mbed
00043 #endif // __MBED_NET_SOCKETS_V0_SOCKETADDR_H__