{
	"id": "20bf80d7-d0e1-4ffa-a54a-4d9d1ba984ef",
	"created_at": "2026-04-06T01:31:22.335264Z",
	"updated_at": "2026-04-10T03:21:21.618638Z",
	"deleted_at": null,
	"sha1_hash": "6ad8b8311a1c8bde58ba12209f75cfae06a9d249",
	"title": "NetworkInterface  |  API reference  |  Android Developers",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 165467,
	"plain_text": "NetworkInterface  |  API reference  |  Android Developers\r\nArchived: 2026-04-06 00:37:27 UTC\r\nNetworkInterface Stay organized with collections Save and categorize content\r\nbased on your preferences.\r\npublic final class NetworkInterface\r\nextends Object\r\nThis class represents a Network Interface made up of a name, and a list of IP addresses assigned to this interface.\r\nIt is used to identify the local interface on which a multicast group is joined. Interfaces are normally known by\r\nnames such as \"le0\".\r\nNote that information about NetworkInterface s may be restricted. For example, non-system apps will only have\r\naccess to information about NetworkInterface s that are associated with an InetAddress .\r\nSummary\r\nPublic methods\r\nboolean\r\nequals(Object obj)\r\nCompares this object against the specified object.\r\nstatic NetworkInterface\r\ngetByIndex(int index)\r\nGet a network interface given its index.\r\nstatic NetworkInterface\r\ngetByInetAddress(InetAddress addr)\r\nConvenience method to search for a network interface that has the\r\nspecified Internet Protocol (IP) address bound to it.\r\nstatic NetworkInterface\r\ngetByName(String name)\r\nSearches for the network interface with the specified name.\r\nString getDisplayName()\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 1 of 12\n\nGet the display name of this network interface.\r\nbyte[]\r\ngetHardwareAddress()\r\nReturns the hardware address (usually MAC) of the interface if it has\r\none and if it can be accessed given the current privileges.\r\nint\r\ngetIndex()\r\nReturns the index of this network interface.\r\nEnumeration\u003cInetAddress\u003e\r\ngetInetAddresses()\r\nConvenience method to return an Enumeration with all or a subset of\r\nthe InetAddresses bound to this network interface.\r\nList\u003cInterfaceAddress\u003e\r\ngetInterfaceAddresses()\r\nGet a List of all or a subset of the InterfaceAddresses of this\r\nnetwork interface.\r\nint\r\ngetMTU()\r\nReturns the Maximum Transmission Unit (MTU) of this interface.\r\nString\r\ngetName()\r\nGet the name of this network interface.\r\nstatic\r\nEnumeration\u003cNetworkInterface\u003e\r\ngetNetworkInterfaces()\r\nReturns all the interfaces on this machine.\r\nNetworkInterface\r\ngetParent()\r\nReturns the parent NetworkInterface of this interface if this is a\r\nsubinterface, or null if it is a physical (non virtual) interface or has\r\nno parent.\r\nEnumeration\u003cNetworkInterface\u003e\r\ngetSubInterfaces()\r\nGet an Enumeration with all the subinterfaces (also known as virtual\r\ninterfaces) attached to this network interface.\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 2 of 12\n\nint\r\nhashCode()\r\nReturns a hash code value for the object.\r\nboolean\r\nisLoopback()\r\nReturns whether a network interface is a loopback interface.\r\nboolean\r\nisPointToPoint()\r\nReturns whether a network interface is a point to point interface.\r\nboolean\r\nisUp()\r\nReturns whether a network interface is up and running.\r\nboolean\r\nisVirtual()\r\nReturns whether this interface is a virtual interface (also called\r\nsubinterface).\r\nboolean\r\nsupportsMulticast()\r\nReturns whether a network interface supports multicasting or not.\r\nString\r\ntoString()\r\nReturns a string representation of the object.\r\nInherited methods\r\nFrom class java.lang.Object\r\nObject\r\nclone()\r\nCreates and returns a copy of this object.\r\nboolean\r\nequals(Object obj)\r\nIndicates whether some other object is \"equal to\" this one.\r\nvoid finalize()\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 3 of 12\n\nCalled by the garbage collector on an object when garbage collection determines that\r\nthere are no more references to the object.\r\nfinal\r\nClass\u003c?\u003e\r\ngetClass()\r\nReturns the runtime class of this Object .\r\nint\r\nhashCode()\r\nReturns a hash code value for the object.\r\nfinal void\r\nnotify()\r\nWakes up a single thread that is waiting on this object's monitor.\r\nfinal void\r\nnotifyAll()\r\nWakes up all threads that are waiting on this object's monitor.\r\nString\r\ntoString()\r\nReturns a string representation of the object.\r\nfinal void\r\nwait(long timeoutMillis, int nanos)\r\nCauses the current thread to wait until it is awakened, typically by being notified or\r\ninterrupted, or until a certain amount of real time has elapsed.\r\nfinal void\r\nwait(long timeoutMillis)\r\nCauses the current thread to wait until it is awakened, typically by being notified or\r\ninterrupted, or until a certain amount of real time has elapsed.\r\nfinal void\r\nwait()\r\nCauses the current thread to wait until it is awakened, typically by being notified or\r\ninterrupted.\r\nPublic methods\r\nequals\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 4 of 12\n\npublic boolean equals (Object obj)\r\nCompares this object against the specified object. The result is true if and only if the argument is not null and\r\nit represents the same NetworkInterface as this object.\r\nTwo instances of NetworkInterface represent the same NetworkInterface if both name and addrs are the same\r\nfor both.\r\nParameters\r\nobj Object : the object to compare against.\r\nReturns\r\nboolean true if the objects are the same; false otherwise.\r\ngetByIndex\r\npublic static NetworkInterface getByIndex (int index)\r\nGet a network interface given its index.\r\nParameters\r\nindex int : an integer, the index of the interface\r\nReturns\r\nNetworkInterface\r\nthe NetworkInterface obtained from its index, or null if an interface with the\r\nspecified index does not exist or can't be accessed.\r\nThrows\r\nIllegalArgumentException if index has a negative value\r\nSocketException if an I/O error occurs.\r\ngetByInetAddress\r\npublic static NetworkInterface getByInetAddress (InetAddress addr)\r\nConvenience method to search for a network interface that has the specified Internet Protocol (IP) address bound\r\nto it.\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 5 of 12\n\nIf the specified IP address is bound to multiple network interfaces it is not defined which network interface is\r\nreturned.\r\nParameters\r\naddr InetAddress : The InetAddress to search with.\r\nReturns\r\nNetworkInterface\r\nA NetworkInterface or null if there is no network interface with the specified IP\r\naddress.\r\nThrows\r\nNullPointerException If the specified address is null .\r\nSocketException If an I/O error occurs.\r\ngetByName\r\npublic static NetworkInterface getByName (String name)\r\nSearches for the network interface with the specified name.\r\nParameters\r\nname String : The name of the network interface.\r\nReturns\r\nNetworkInterface\r\nA NetworkInterface with the specified name, or null if the network interface with\r\nthe specified name does not exist or can't be accessed.\r\nThrows\r\nNullPointerException If the specified name is null .\r\nSocketException If an I/O error occurs.\r\ngetDisplayName\r\npublic String getDisplayName ()\r\nGet the display name of this network interface. A display name is a human readable String describing the network\r\ndevice.\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 6 of 12\n\nReturns\r\nString\r\na non-empty string representing the display name of this network interface, or null if no display\r\nname is available.\r\ngetHardwareAddress\r\npublic byte[] getHardwareAddress ()\r\nReturns the hardware address (usually MAC) of the interface if it has one and if it can be accessed given the\r\ncurrent privileges. If a security manager is set, then the caller must have the permission\r\nNetPermission (\"getNetworkInformation\").\r\nReturns\r\nbyte[]\r\na byte array containing the address, or null if the address doesn't exist, is not accessible or a\r\nsecurity manager is set and the caller does not have the permission\r\nNetPermission(\"getNetworkInformation\"). For example, this method will generally return null\r\nwhen called by non-system apps (or 02:00:00:00:00:00 for apps having targetSdkVersion \u003c\r\nandroid.os.Build.VERSION_CODES.R ).\r\nThrows\r\nSocketException if an I/O error occurs.\r\ngetIndex\r\npublic int getIndex ()\r\nReturns the index of this network interface. The index is an integer greater or equal to zero, or -1 for unknown.\r\nThis is a system specific value and interfaces with the same name can have different indexes on different\r\nmachines.\r\nReturns\r\nint the index of this network interface or -1 if the index is unknown\r\ngetInetAddresses\r\npublic Enumeration\u003cInetAddress\u003e getInetAddresses ()\r\nConvenience method to return an Enumeration with all or a subset of the InetAddresses bound to this network\r\ninterface.\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 7 of 12\n\nIf there is a security manager, its checkConnect method is called for each InetAddress. Only InetAddresses\r\nwhere the checkConnect doesn't throw a SecurityException will be returned in the Enumeration. However, if the\r\ncaller has the NetPermission (\"getNetworkInformation\") permission, then all InetAddresses are returned.\r\nReturns\r\nEnumeration\u003cInetAddress\u003e\r\nan Enumeration object with all or a subset of the InetAddresses bound to this\r\nnetwork interface\r\ngetInterfaceAddresses\r\npublic List\u003cInterfaceAddress\u003e getInterfaceAddresses ()\r\nGet a List of all or a subset of the InterfaceAddresses of this network interface.\r\nIf there is a security manager, its checkConnect method is called with the InetAddress for each InterfaceAddress.\r\nOnly InterfaceAddresses where the checkConnect doesn't throw a SecurityException will be returned in the List.\r\nReturns\r\nList\u003cInterfaceAddress\u003e\r\na List object with all or a subset of the InterfaceAddresss of this network\r\ninterface\r\ngetMTU\r\npublic int getMTU ()\r\nReturns the Maximum Transmission Unit (MTU) of this interface.\r\nReturns\r\nint the value of the MTU for that interface.\r\nThrows\r\nSocketException if an I/O error occurs.\r\ngetName\r\npublic String getName ()\r\nGet the name of this network interface.\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 8 of 12\n\nReturns\r\nString the name of this network interface\r\ngetNetworkInterfaces\r\npublic static Enumeration\u003cNetworkInterface\u003e getNetworkInterfaces ()\r\nReturns all the interfaces on this machine. The Enumeration contains at least one element, possibly representing\r\na loopback interface that only supports communication between entities on this machine. NOTE: can use\r\ngetNetworkInterfaces()+getInetAddresses() to obtain all IP addresses for this node\r\nFor non-system apps, this method will only return information for NetworkInterface s associated with an\r\nInetAddress .\r\nANDROID NOTE: On Android versions before S (API level 31), this method may throw a NullPointerException\r\nif called in an environment where there is a virtual interface without a parent interface present.\r\nReturns\r\nEnumeration\u003cNetworkInterface\u003e\r\nan Enumeration of NetworkInterfaces found on this machine that are\r\naccessible.\r\nThrows\r\nSocketException if an I/O error occurs.\r\ngetParent\r\npublic NetworkInterface getParent ()\r\nReturns the parent NetworkInterface of this interface if this is a subinterface, or null if it is a physical (non\r\nvirtual) interface or has no parent.\r\nReturns\r\nNetworkInterface The NetworkInterface this interface is attached to.\r\ngetSubInterfaces\r\npublic Enumeration\u003cNetworkInterface\u003e getSubInterfaces ()\r\nGet an Enumeration with all the subinterfaces (also known as virtual interfaces) attached to this network interface.\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 9 of 12\n\nFor instance eth0:1 will be a subinterface to eth0.\r\nReturns\r\nEnumeration\u003cNetworkInterface\u003e\r\nan Enumeration object with all of the subinterfaces of this network\r\ninterface\r\nhashCode\r\npublic int hashCode ()\r\nReturns a hash code value for the object. This method is supported for the benefit of hash tables such as those\r\nprovided by HashMap .\r\nThe general contract of hashCode is:\r\nWhenever it is invoked on the same object more than once during an execution of a Java application, the\r\nhashCode method must consistently return the same integer, provided no information used in equals\r\ncomparisons on the object is modified. This integer need not remain consistent from one execution of an\r\napplication to another execution of the same application.\r\nIf two objects are equal according to the equals method, then calling the hashCode method on each of\r\nthe two objects must produce the same integer result.\r\nIt is not required that if two objects are unequal according to the equals method, then calling the\r\nhashCode method on each of the two objects must produce distinct integer results. However, the\r\nprogrammer should be aware that producing distinct integer results for unequal objects may improve the\r\nperformance of hash tables.\r\nReturns\r\nint a hash code value for this object.\r\nisLoopback\r\npublic boolean isLoopback ()\r\nReturns whether a network interface is a loopback interface.\r\nReturns\r\nboolean true if the interface is a loopback interface.\r\nThrows\r\nSocketException if an I/O error occurs.\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 10 of 12\n\nisPointToPoint\r\npublic boolean isPointToPoint ()\r\nReturns whether a network interface is a point to point interface. A typical point to point interface would be a PPP\r\nconnection through a modem.\r\nReturns\r\nboolean true if the interface is a point to point interface.\r\nThrows\r\nSocketException if an I/O error occurs.\r\nisUp\r\npublic boolean isUp ()\r\nReturns whether a network interface is up and running.\r\nReturns\r\nboolean true if the interface is up and running.\r\nThrows\r\nSocketException if an I/O error occurs.\r\nisVirtual\r\npublic boolean isVirtual ()\r\nReturns whether this interface is a virtual interface (also called subinterface). Virtual interfaces are, on some\r\nsystems, interfaces created as a child of a physical interface and given different settings (like address or MTU).\r\nUsually the name of the interface will the name of the parent followed by a colon (:) and a number identifying the\r\nchild since there can be several virtual interfaces attached to a single physical interface.\r\nReturns\r\nboolean true if this interface is a virtual interface.\r\nsupportsMulticast\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 11 of 12\n\npublic boolean supportsMulticast ()\r\nReturns whether a network interface supports multicasting or not.\r\nReturns\r\nboolean true if the interface supports Multicasting.\r\nThrows\r\nSocketException if an I/O error occurs.\r\ntoString\r\npublic String toString ()\r\nReturns a string representation of the object.\r\nReturns\r\nString a string representation of the object.\r\nSource: https://developer.android.com/reference/java/net/NetworkInterface.html\r\nhttps://developer.android.com/reference/java/net/NetworkInterface.html\r\nPage 12 of 12",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://developer.android.com/reference/java/net/NetworkInterface.html"
	],
	"report_names": [
		"NetworkInterface.html"
	],
	"threat_actors": [],
	"ts_created_at": 1775439082,
	"ts_updated_at": 1775791281,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/6ad8b8311a1c8bde58ba12209f75cfae06a9d249.pdf",
		"text": "https://archive.orkl.eu/6ad8b8311a1c8bde58ba12209f75cfae06a9d249.txt",
		"img": "https://archive.orkl.eu/6ad8b8311a1c8bde58ba12209f75cfae06a9d249.jpg"
	}
}