1 /* 2 * Copyright (C) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_DHCP_IPV6_DEFINE_H 17 #define OHOS_DHCP_IPV6_DEFINE_H 18 namespace OHOS { 19 namespace DHCP { 20 inline const int IPV6_ADDR_ANY = 0x0000U; 21 inline const int IPV6_ADDR_UNICAST = 0x0001U; 22 inline const int IPV6_ADDR_MULTICAST = 0x0002U; 23 inline const int IPV6_ADDR_SCOPE_MASK = 0x00F0U; 24 inline const int IPV6_ADDR_LOOPBACK = 0x0010U; 25 inline const int IPV6_ADDR_LINKLOCAL = 0x0020U; 26 inline const int IPV6_ADDR_SITELOCAL = 0x0040U; 27 inline const int IPV6_ADDR_COMPATV4 = 0x0080U; 28 inline const int IPV6_ADDR_MAPPED = 0x1000U; 29 inline const unsigned int IPV6_ADDR_SCOPE_NODELOCAL = 0X01; 30 inline const unsigned int IPV6_ADDR_SCOPE_LINKLOCAL = 0X02; 31 inline const unsigned int IPV6_ADDR_SCOPE_SITELOCAL = 0X05; 32 inline const int IPV6_ADDR_SCOPE_GLOBAL = 0X0E; 33 inline const int S6_ADDR_INDEX_ZERO = 0; 34 inline const int S6_ADDR_INDEX_FIRST = 1; 35 inline const int S6_ADDR_INDEX_SECOND = 2; 36 inline const int S6_ADDR_INDEX_THIRD = 3; 37 inline const int ADDRTYPE_FLAG_ZERO = 0x00000000; 38 inline const int ADDRTYPE_FLAG_ONE = 0x00000001; 39 inline const int ADDRTYPE_FLAG_LOWF = 0x0000ffff; 40 inline const int ADDRTYPE_FLAG_HIGHE = 0xE0000000; 41 inline const int ADDRTYPE_FLAG_HIGHFF = 0xFF000000; 42 inline const int ADDRTYPE_FLAG_HIGHFFC = 0xFFC00000; 43 inline const int ADDRTYPE_FLAG_HIGHFE8 = 0xFE800000; 44 inline const int ADDRTYPE_FLAG_HIGHFEC = 0xFEC00000; 45 inline const int ADDRTYPE_FLAG_HIGHFE = 0xFE000000; 46 inline const int ADDRTYPE_FLAG_HIGHFC = 0xFC000000; 47 inline const int MASK_FILTER = 0x7; 48 inline const int KERNEL_BUFF_SIZE = (64 * 1024); 49 inline const int ND_OPT_MIN_LEN = 3; 50 inline const int ROUTE_BUFF_SIZE = 1024; 51 inline const int POSITION_OFFSET_1 = 1; 52 inline const int POSITION_OFFSET_2 = 2; 53 inline const int POSITION_OFFSET_3 = 3; 54 inline const int POSITION_OFFSET_4 = 4; 55 inline const int SIXTEEN = 16; IPV6_ADDR_SCOPE_TYPE(int scope)56inline int IPV6_ADDR_SCOPE_TYPE(int scope) { return (scope) << SIXTEEN; } 57 } // namespace DHCP 58 } // namespace OHOS 59 #endif /* OHOS_DHCP_IPV6_DEFINE_H */ 60