Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ns_address.h Source File

ns_address.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2010-2016 ARM Limited. All rights reserved.
00003  *
00004  * SPDX-License-Identifier: LicenseRef-PBL
00005  *
00006  * Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  * https://www.mbed.com/licenses/PBL-1.0
00010  *
00011  * See the License for the specific language governing permissions and limitations under the License.
00012  *
00013  */
00014 #ifndef _NS_LIB_ADDRESS_H
00015 #define _NS_LIB_ADDRESS_H
00016 /**
00017  * \file ns_address.h
00018  * \brief 6LowPAN library address format description.
00019  *
00020  */
00021 #include "ns_types.h"
00022 
00023 /**
00024  * /enum address_type_t
00025  * /brief Address types.
00026  */
00027 typedef enum address_type_t {
00028     ADDRESS_IPV6,                 /**< IPv6 Address type. Must be used always at socket interface. */
00029     ADDRESS_IPV4,                 /**< IPv4 Address type. Must be used always at socket interface. */
00030     ADDRESS_TUN_DRIVER_ID         /**< Local socket address type. The length is 1 byte (driver ID for packet source). */
00031 } address_type_t;
00032 
00033 
00034 /**
00035  * /struct ns_address_t
00036  * /brief Struct for the addresses used by the socket interface functions and net_address_get().
00037  */
00038 typedef struct ns_address {
00039     address_type_t type;          /**< Address type. */
00040     uint8_t address[16];          /**< Address. */
00041     uint16_t identifier;          /**< TCP/UDP port number. */
00042 } ns_address_t;
00043 
00044 #endif /* _NS_ADDRESS_H */