Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * |
Rob Walker | e812e67 | 2020-03-31 17:51:57 -0700 | [diff] [blame] | 3 | * Copyright (c) 2020 Project CHIP Authors |
| 4 | * Copyright (c) 2015-2017 Nest Labs, Inc. |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | /** |
| 20 | * @file |
| 21 | * This file contains constants corresponding to numbers assigned |
| 22 | * by the Internet Assigned Number Authority (IANA) that are used |
| 23 | * in the abstract programming interface of the Inet layer, and |
| 24 | * which are defined independently here from their corresponding |
| 25 | * definitions in any underlying IP stacks. |
| 26 | */ |
| 27 | |
Andrei Litvin | 1873e8c | 2020-10-12 10:52:26 -0400 | [diff] [blame] | 28 | #pragma once |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 29 | |
| 30 | namespace chip { |
| 31 | namespace Inet { |
| 32 | |
| 33 | /** |
| 34 | * @enum IPVersion |
| 35 | * |
| 36 | * The version of the IP protocol being used. |
| 37 | * |
| 38 | */ |
| 39 | typedef enum |
| 40 | { |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 41 | kIPVersion_6 = 6, /**< IPv6 */ |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 42 | #if INET_CONFIG_ENABLE_IPV4 |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 43 | kIPVersion_4 = 4, /**< IPv4 */ |
| 44 | #endif // INET_CONFIG_ENABLE_IPV4 |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 45 | } IPVersion; |
| 46 | |
| 47 | /** |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 48 | * @brief Internet protocol multicast address scope |
| 49 | * |
| 50 | * @details |
| 51 | * Values of the \c IPv6MulticastScope type are used to call the |
| 52 | * <tt>IPAddress::MakeIPv6Multicast()</tt> method. They indicate the routable |
| 53 | * scope of the multicast group designated by the result. These numbers are |
| 54 | * registered by IETF with IANA. |
| 55 | */ |
| 56 | typedef enum |
| 57 | { |
| 58 | /** Interface-local scope. */ |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 59 | kIPv6MulticastScope_Interface = 1, |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 60 | |
| 61 | /** Link-local scope. */ |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 62 | kIPv6MulticastScope_Link = 2, |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 63 | |
| 64 | #if INET_CONFIG_ENABLE_IPV4 |
| 65 | /** Realm-local ("IPv4") scope. */ |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 66 | kIPv6MulticastScope_IPv4 = 3, |
| 67 | #else // !INET_CONFIG_ENABLE_IPV4 |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 68 | /** Realm-local scope. */ |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 69 | kIPv6MulticastScope_Realm = 3, |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 70 | #endif // !INET_CONFIG_ENABLE_IPV4 |
| 71 | |
| 72 | /** Realm-local scope. */ |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 73 | kIPv6MulticastScope_Admin = 4, |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 74 | |
| 75 | /** Realm-local scope. */ |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 76 | kIPv6MulticastScope_Site = 5, |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 77 | |
| 78 | /** Organization-local scope. */ |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 79 | kIPv6MulticastScope_Organization = 8, |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 80 | |
| 81 | /** Global scope. */ |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 82 | kIPv6MulticastScope_Global = 14 |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 83 | } IPv6MulticastScope; |
| 84 | |
| 85 | /** |
| 86 | * @brief Internet protocol multicast group identifiers |
| 87 | * |
| 88 | * @details |
| 89 | * Values of the \c IPV6MulticastGroup type are used to call the |
| 90 | * <tt>IPAddress::MakeIPv6Multicast()</tt> method. They indicate |
| 91 | * distinguished group identifiers registered by IETF with IANA. |
| 92 | */ |
| 93 | enum IPV6MulticastGroup |
| 94 | { |
Martin Turon | cd17ad4 | 2020-03-18 20:03:53 -0700 | [diff] [blame] | 95 | kIPV6MulticastGroup_AllNodes = 1, /** RFC 4291 */ |
| 96 | kIPV6MulticastGroup_AllRouters = 2 /** RFC 4291 */ |
Pankaj Garg | 2efbcce | 2020-03-10 12:05:08 -0700 | [diff] [blame] | 97 | }; |
| 98 | |
| 99 | } // namespace Inet |
| 100 | } // namespace chip |