1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.server.wifi.nl80211; 18 19 /** 20 * Constants used by Netlink and Nl80211. 21 */ 22 public class NetlinkConstants { 23 // Netlink protocols. See kernel/uapi/linux/netlink.h 24 public static final int NETLINK_GENERIC = 16; 25 26 // Control message types. See kernel/uapi/linux/genetlink.h 27 public static final short GENL_ID_CTRL = 0x10; 28 29 // Control message commands. See kernel/uapi/linux/genetlink.h 30 public static final short CTRL_CMD_NEWFAMILY = 1; 31 public static final short CTRL_CMD_GETFAMILY = 3; 32 33 // Control message attributes. See kernel/uapi/linux/genetlink.h 34 public static final short CTRL_ATTR_FAMILY_ID = 1; 35 public static final short CTRL_ATTR_FAMILY_NAME = 2; 36 37 public static final short CTRL_ATTR_MCAST_GRP_NAME = 1; 38 public static final short CTRL_ATTR_MCAST_GRP_ID = 2; 39 40 public static final short CTRL_ATTR_MCAST_GROUPS = 7; 41 42 // Nl80211 strings for initialization. See kernel/uapi/linux/nl80211.h 43 public static final String NL80211_GENL_NAME = "nl80211"; 44 public static final String NL80211_MULTICAST_GROUP_SCAN = "scan"; 45 public static final String NL80211_MULTICAST_GROUP_REG = "regulatory"; 46 public static final String NL80211_MULTICAST_GROUP_MLME = "mlme"; 47 } 48