1 /* 2 * Copyright (C) 2016 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 android.system; 18 19 import java.net.InetAddress; 20 21 /** 22 * Information returned by {@link Os#getifaddrs}. Loosely corresponds to C's 23 * {@code struct ifaddrs} from {@code <ifaddrs.h>}. 24 * 25 * @hide 26 */ 27 public final class StructIfaddrs { 28 public final String ifa_name; 29 public final int ifa_flags; 30 public final InetAddress ifa_addr; 31 public final InetAddress ifa_netmask; 32 public final InetAddress ifa_broadaddr; 33 public final byte[] hwaddr; 34 35 /** 36 * Constructs an instance with the given field values. 37 */ 38 public StructIfaddrs(String ifa_name, int ifa_flags, InetAddress ifa_addr, InetAddress ifa_netmask, 39 InetAddress ifa_broadaddr, byte[] hwaddr) { 40 this.ifa_name = ifa_name; 41 this.ifa_flags = ifa_flags; 42 this.ifa_addr = ifa_addr; 43 this.ifa_netmask = ifa_netmask; 44 this.ifa_broadaddr = ifa_broadaddr; 45 this.hwaddr = hwaddr; 46 } 47 } 48