Nicolas Borla / Mbed OS BBR_1Ebene
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-2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
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 _NS_LIB_ADDRESS_H
00018 #define _NS_LIB_ADDRESS_H
00019 /**
00020  * \file ns_address.h
00021  * \brief 6LowPAN library address format description.
00022  *
00023  */
00024 #include "ns_types.h"
00025 
00026 /**
00027  * /enum address_type_t
00028  * /brief Address types.
00029  */
00030 typedef enum address_type_t {
00031     ADDRESS_IPV6,                 /**< IPv6 Address type. Must be used always at socket interface. */
00032     ADDRESS_IPV4,                 /**< IPv4 Address type. Must be used always at socket interface. */
00033     ADDRESS_TUN_DRIVER_ID         /**< Local socket address type. The length is 1 byte (driver ID for packet source). */
00034 } address_type_t;
00035 
00036 
00037 /**
00038  * /struct ns_address_t
00039  * /brief Struct for the addresses used by the socket interface functions and net_address_get().
00040  */
00041 typedef struct ns_address {
00042     address_type_t type;          /**< Address type. */
00043     uint8_t address[16];          /**< Address. */
00044     uint16_t identifier;          /**< TCP/UDP port number. */
00045 } ns_address_t;
00046 
00047 #endif /* _NS_ADDRESS_H */