diff --git a/radio/1.1/Android.mk b/radio/1.1/Android.mk index 21c4a6aeaa..b83ac8021c 100644 --- a/radio/1.1/Android.mk +++ b/radio/1.1/Android.mk @@ -93,6 +93,82 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (KeepaliveRequest) +# +GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.radio@1.1::types.KeepaliveRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (KeepaliveStatus) +# +GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.radio@1.1::types.KeepaliveStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (KeepaliveStatusCode) +# +GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveStatusCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.radio@1.1::types.KeepaliveStatusCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (KeepaliveType) +# +GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.radio@1.1::types.KeepaliveType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NetworkScanRequest) # @@ -275,6 +351,8 @@ GEN := $(intermediates)/android/hardware/radio/V1_1/IRadioResponse.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioResponse.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ @@ -380,6 +458,82 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (KeepaliveRequest) +# +GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.radio@1.1::types.KeepaliveRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (KeepaliveStatus) +# +GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.radio@1.1::types.KeepaliveStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (KeepaliveStatusCode) +# +GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveStatusCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.radio@1.1::types.KeepaliveStatusCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (KeepaliveType) +# +GEN := $(intermediates)/android/hardware/radio/V1_1/KeepaliveType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.radio@1.1::types.KeepaliveType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NetworkScanRequest) # @@ -562,6 +716,8 @@ GEN := $(intermediates)/android/hardware/radio/V1_1/IRadioResponse.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IRadioResponse.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ diff --git a/radio/1.1/IRadio.hal b/radio/1.1/IRadio.hal index ea9b96f676..22d27d4563 100644 --- a/radio/1.1/IRadio.hal +++ b/radio/1.1/IRadio.hal @@ -89,4 +89,24 @@ interface IRadio extends @1.0::IRadio { * Response function is IRadioResponse.stopNetworkScanResponse() */ oneway stopNetworkScan(int32_t serial); + + /** + * Start a Keepalive session (for IPsec) + * + * @param serial Serial number of request. + * @param keepalive A request structure containing all necessary info to describe a keepalive + * + * Response function is IRadioResponse.startKeepaliveResponse() + */ + oneway startKeepalive(int32_t serial, KeepaliveRequest keepalive); + + /** + * Stop an ongoing Keepalive session (for IPsec) + * + * @param serial Serial number of request. + * @param sessionHandle The handle that was provided by IRadioResponse.startKeepaliveResponse + * + * Response function is IRadioResponse.stopKeepaliveResponse() + */ + oneway stopKeepalive(int32_t serial, int32_t sessionHandle); }; diff --git a/radio/1.1/IRadioIndication.hal b/radio/1.1/IRadioIndication.hal index 27b6ec20e0..a0ad9b2f78 100644 --- a/radio/1.1/IRadioIndication.hal +++ b/radio/1.1/IRadioIndication.hal @@ -39,4 +39,15 @@ interface IRadioIndication extends @1.0::IRadioIndication{ * @param result Network scan result as NetworkScanResult defined in types.hal */ oneway networkScanResult(RadioIndicationType type, NetworkScanResult result); -}; \ No newline at end of file + + /** + * Indicates a status update for a particular Keepalive session. This must include + * a handle for a previous session and should include a status update regarding the + * state of a keepalive. Unsolicited keepalive status reports should never be + * PENDING as unsolicited status should only be sent when known. + * + * @param type Type of radio indication + * @param status Status information for a Keepalive session + */ + oneway keepaliveStatus(RadioIndicationType type, KeepaliveStatus status); +}; diff --git a/radio/1.1/IRadioResponse.hal b/radio/1.1/IRadioResponse.hal index 7415252216..4e7bf43dec 100644 --- a/radio/1.1/IRadioResponse.hal +++ b/radio/1.1/IRadioResponse.hal @@ -71,4 +71,26 @@ interface IRadioResponse extends @1.0::IRadioResponse { * RadioError:MODEM_ERR */ oneway stopNetworkScanResponse(RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param status Status object containing a new handle and a current status. The + * status returned here may be PENDING to indicate that the radio has not yet + * processed the keepalive request. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:NO_RESOURCES + * RadioError:INVALID_ARGUMENTS + */ + oneway startKeepaliveResponse(RadioResponseInfo info, KeepaliveStatus status); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + */ + oneway stopKeepaliveResponse(RadioResponseInfo info); }; diff --git a/radio/1.1/types.hal b/radio/1.1/types.hal index bdd0338d97..a8d836c88c 100644 --- a/radio/1.1/types.hal +++ b/radio/1.1/types.hal @@ -132,6 +132,19 @@ enum ScanStatus : int32_t { COMPLETE = 2, // The result contains the last part of the scan results }; +enum KeepaliveType : int32_t { + NATT_IPV4 = 0, // Keepalive specified by RFC 3948 Sec. 2.3 using IPv4 + NATT_IPV6 = 1, // Keepalive specified by RFC 3948 Sec. 2.3 using IPv6 +}; + +enum KeepaliveStatusCode : int32_t { + ACTIVE, // Keepalive is currently active + INACTIVE, // Keepalive is inactive, which indicates an error + PENDING, // Requested keepalive has not yet been processed by + // the modem. Only allowed in a RESPONSE message to + // a REQUEST +}; + struct RadioAccessSpecifier { RadioAccessNetworks radioAccessNetwork; // The type of network to scan vec geranBands; // Valid only if radioAccessNetwork = GERAN @@ -182,3 +195,24 @@ struct ImsiEncryptionInfo { // identity. int64_t expirationTime; // date-time in UTC when the key will expire. }; + +struct KeepaliveRequest { + KeepaliveType type; // The format of the keepalive packet + vec sourceAddress; // source address with type = family, in network + // byte order + int32_t sourcePort; // source port if relevant for the given type + // INT_MAX: 0x7FFFFFFF denotes that the field is unused + vec destinationAddress; // destination address with type = family, in network + // byte order + int32_t destinationPort; // destination if relevant for the given type + // INT_MAX: 0x7FFFFFFF denotes that the field is unused + int32_t maxKeepaliveIntervalMillis; // the max interval between packets, in milliseconds + int32_t cid; // Context ID, returned in setupDataCallResponse + // that uniquely identifies the data call to which + // this keepalive must applied +}; + +struct KeepaliveStatus { + int32_t sessionHandle; // the sessionHandle provided by the api + KeepaliveStatusCode code; // status for the given keepalive +};