blob: 4d9038da61b4bb870de585d7267259e0085a13b5 [file] [log] [blame]
Pankaj Garg2efbcce2020-03-10 12:05:08 -07001/*
2 *
Rob Walkere812e672020-03-31 17:51:57 -07003 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2015-2017 Nest Labs, Inc.
Pankaj Garg2efbcce2020-03-10 12:05:08 -07005 *
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 Litvin1873e8c2020-10-12 10:52:26 -040028#pragma once
Pankaj Garg2efbcce2020-03-10 12:05:08 -070029
30namespace chip {
31namespace Inet {
32
33/**
34 * @enum IPVersion
35 *
36 * The version of the IP protocol being used.
37 *
38 */
39typedef enum
40{
Martin Turoncd17ad42020-03-18 20:03:53 -070041 kIPVersion_6 = 6, /**< IPv6 */
Pankaj Garg2efbcce2020-03-10 12:05:08 -070042#if INET_CONFIG_ENABLE_IPV4
Martin Turoncd17ad42020-03-18 20:03:53 -070043 kIPVersion_4 = 4, /**< IPv4 */
44#endif // INET_CONFIG_ENABLE_IPV4
Pankaj Garg2efbcce2020-03-10 12:05:08 -070045} IPVersion;
46
47/**
Pankaj Garg2efbcce2020-03-10 12:05:08 -070048 * @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 */
56typedef enum
57{
58 /** Interface-local scope. */
Martin Turoncd17ad42020-03-18 20:03:53 -070059 kIPv6MulticastScope_Interface = 1,
Pankaj Garg2efbcce2020-03-10 12:05:08 -070060
61 /** Link-local scope. */
Martin Turoncd17ad42020-03-18 20:03:53 -070062 kIPv6MulticastScope_Link = 2,
Pankaj Garg2efbcce2020-03-10 12:05:08 -070063
64#if INET_CONFIG_ENABLE_IPV4
65 /** Realm-local ("IPv4") scope. */
Martin Turoncd17ad42020-03-18 20:03:53 -070066 kIPv6MulticastScope_IPv4 = 3,
67#else // !INET_CONFIG_ENABLE_IPV4
Pankaj Garg2efbcce2020-03-10 12:05:08 -070068 /** Realm-local scope. */
Martin Turoncd17ad42020-03-18 20:03:53 -070069 kIPv6MulticastScope_Realm = 3,
Pankaj Garg2efbcce2020-03-10 12:05:08 -070070#endif // !INET_CONFIG_ENABLE_IPV4
71
72 /** Realm-local scope. */
Martin Turoncd17ad42020-03-18 20:03:53 -070073 kIPv6MulticastScope_Admin = 4,
Pankaj Garg2efbcce2020-03-10 12:05:08 -070074
75 /** Realm-local scope. */
Martin Turoncd17ad42020-03-18 20:03:53 -070076 kIPv6MulticastScope_Site = 5,
Pankaj Garg2efbcce2020-03-10 12:05:08 -070077
78 /** Organization-local scope. */
Martin Turoncd17ad42020-03-18 20:03:53 -070079 kIPv6MulticastScope_Organization = 8,
Pankaj Garg2efbcce2020-03-10 12:05:08 -070080
81 /** Global scope. */
Martin Turoncd17ad42020-03-18 20:03:53 -070082 kIPv6MulticastScope_Global = 14
Pankaj Garg2efbcce2020-03-10 12:05:08 -070083} 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 */
93enum IPV6MulticastGroup
94{
Martin Turoncd17ad42020-03-18 20:03:53 -070095 kIPV6MulticastGroup_AllNodes = 1, /** RFC 4291 */
96 kIPV6MulticastGroup_AllRouters = 2 /** RFC 4291 */
Pankaj Garg2efbcce2020-03-10 12:05:08 -070097};
98
99} // namespace Inet
100} // namespace chip