1 /* 2 * Copyright (c) 2023 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 #ifndef WIFI_DIRECT_DEFINES_H 16 #define WIFI_DIRECT_DEFINES_H 17 18 #define MIN(a, b) ((a) < (b) ? (a) : (b)) 19 20 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) 21 22 #define MAC_ADDR_STR_LEN 32 23 #define MAC_ADDR_ARRAY_SIZE 6 24 #define GROUP_CONFIG_STR_LEN 256 25 #define WIFI_CFG_INFO_MAX_LEN 512 26 27 #define IP_NUM_MAX 32 28 #define IF_NAME_HML "chba0" 29 #define IF_NAME_P2P0 "p2p0" 30 #define IF_NAME_WLAN "wlan0" 31 #define IF_NAME_WLAN1 "wlan1" 32 33 #define IPV4_ADDR_ARRAY_LEN 4 34 #define DEFAULT_PREFIX_LEN 24 35 36 #define REQUEST_ID_INVALID (-1) 37 38 #define HML_IP_NET_PREFIX "172.30." 39 #define BYPASS_MAC "FF:FF:FF:FF:FF:FF" 40 #define SSID_PREFIX "Direct-" 41 #define SSID_PREFIX_LEN 7 42 #define SSID_SUFFIX_LEN 4 43 #define WIFI_DIRECT_SSID_LEN (SSID_PREFIX_LEN + SSID_SUFFIX_LEN + 1) 44 #define WIFI_DIRECT_PSK_LEN 8 45 #define NETWORK_ID_SHORT_HASH_BIN_LEN 4 46 #define NETWORK_ID_SHORT_HASH_HEX_LEN 8 47 #define CHALLENGE_CODE_LEN 2 48 49 #endif 50