Stay organized with collections
Save and categorize content based on your preferences.
IkeSessionConnectionInfo
class IkeSessionConnectionInfo
IkeSessionConnectionInfo represents the connection information of an IkeSession
.
Connection information includes IP addresses of both the IKE client and server and the network being used.
Summary
Public constructors
Public methods
getLocalAddress
fun getLocalAddress(): InetAddress
Returns the local IP address for the underlying Network
being used.
Return |
InetAddress |
the local IP address. This value cannot be null . |
getNetwork
fun getNetwork(): Network
Returns the underlying Network
being used.
Return |
Network |
the underlying Network that carries all IKE traffic. This value cannot be null . |
getRemoteAddress
fun getRemoteAddress(): InetAddress
Returns the remote IP address for the underlying Network
being used.
Return |
InetAddress |
the remote IP address. This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# IkeSessionConnectionInfo\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nIkeSessionConnectionInfo\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/ipsec/ike/IkeSessionConnectionInfo \"View this page in Java\") \n\n```\nclass IkeSessionConnectionInfo\n```\n\n|---|-----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.ipsec.ike.IkeSessionConnectionInfo](#) |\n\nIkeSessionConnectionInfo represents the connection information of an [IkeSession](/reference/kotlin/android/net/ipsec/ike/IkeSession).\n\nConnection information includes IP addresses of both the IKE client and server and the network being used.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [IkeSessionConnectionInfo](#IkeSessionConnectionInfo(java.net.InetAddress,%20java.net.InetAddress,%20android.net.Network))`(`localAddress:` `[InetAddress](../../../../java/net/InetAddress.html#)`, `remoteAddress:` `[InetAddress](../../../../java/net/InetAddress.html#)`, `network:` `[Network](../../Network.html#)`)` Construct an instance of [IkeSessionConnectionInfo](#). |\n\n| Public methods ||\n|-------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [InetAddress](../../../../java/net/InetAddress.html#) | [getLocalAddress](#getLocalAddress())`()` Returns the local IP address for the underlying [Network](../../Network.html#) being used. |\n| [Network](../../Network.html#) | [getNetwork](#getNetwork())`()` Returns the underlying [Network](../../Network.html#) being used. |\n| [InetAddress](../../../../java/net/InetAddress.html#) | [getRemoteAddress](#getRemoteAddress())`()` Returns the remote IP address for the underlying [Network](../../Network.html#) being used. |\n\nPublic constructors\n-------------------\n\n### IkeSessionConnectionInfo\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIkeSessionConnectionInfo(\n localAddress: InetAddress, \n remoteAddress: InetAddress, \n network: Network)\n```\n\nConstruct an instance of [IkeSessionConnectionInfo](#).\n\nExcept for testing, IKE library users normally do not instantiate [IkeSessionConnectionInfo](#) themselves but instead get a reference via [IkeSessionConfiguration](/reference/kotlin/android/net/ipsec/ike/IkeSessionConfiguration) or [IkeSessionCallback](/reference/kotlin/android/net/ipsec/ike/IkeSessionCallback)\n\n| Parameters ||\n|-----------------|-------------------------------------------------------------------------------------|\n| `localAddress` | [InetAddress](../../../../java/net/InetAddress.html#): This value cannot be `null`. |\n| `remoteAddress` | [InetAddress](../../../../java/net/InetAddress.html#): This value cannot be `null`. |\n| `network` | [Network](../../Network.html#): This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### getLocalAddress\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getLocalAddress(): InetAddress\n```\n\nReturns the local IP address for the underlying [Network](../../Network.html#) being used.\n\n| Return ||\n|-------------------------------------------------------|----------------------------------------------------|\n| [InetAddress](../../../../java/net/InetAddress.html#) | the local IP address. This value cannot be `null`. |\n\n### getNetwork\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getNetwork(): Network\n```\n\nReturns the underlying [Network](../../Network.html#) being used.\n\n| Return ||\n|--------------------------------|----------------------------------------------------------------------------------------------------------|\n| [Network](../../Network.html#) | the underlying [Network](../../Network.html#) that carries all IKE traffic. This value cannot be `null`. |\n\n### getRemoteAddress\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getRemoteAddress(): InetAddress\n```\n\nReturns the remote IP address for the underlying [Network](../../Network.html#) being used.\n\n| Return ||\n|-------------------------------------------------------|-----------------------------------------------------|\n| [InetAddress](../../../../java/net/InetAddress.html#) | the remote IP address. This value cannot be `null`. |"]]