1 /* 2 * Copyright (C) 2020 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.net.ipsec.ike.ike3gpp; 18 19 import android.annotation.IntDef; 20 import android.annotation.SystemApi; 21 22 import java.lang.annotation.Retention; 23 import java.lang.annotation.RetentionPolicy; 24 25 /** 26 * Ike3gppData represents 3GPP-specific data sent by the peer/remote endpoint. 27 * 28 * @see 3GPP ETSI TS 24.302: Access to the 3GPP Evolved Packet Core (EPC) via non-3GPP access 29 * networks 30 * @hide 31 */ 32 @SystemApi 33 public abstract class Ike3gppData { 34 private static final int DATA_TYPE_SHARED_BASE = 0; 35 private static final int DATA_TYPE_CATEGORY_SIZE = 100; 36 37 private static final int DATA_TYPE_PAYLOAD_NOTIFY_BASE = DATA_TYPE_SHARED_BASE; 38 39 /** Data Type representing an {@link Ike3gppN1ModeInformation}. */ 40 public static final int DATA_TYPE_NOTIFY_N1_MODE_INFORMATION = 41 DATA_TYPE_PAYLOAD_NOTIFY_BASE + 1; 42 43 /** Data Type representing an {@link Ike3gppBackoffTimer}. */ 44 public static final int DATA_TYPE_NOTIFY_BACKOFF_TIMER = DATA_TYPE_PAYLOAD_NOTIFY_BASE + 2; 45 46 /** @hide */ 47 @Retention(RetentionPolicy.SOURCE) 48 @IntDef({DATA_TYPE_NOTIFY_N1_MODE_INFORMATION, DATA_TYPE_NOTIFY_BACKOFF_TIMER}) 49 public @interface DataType {} 50 51 /** @hide */ Ike3gppData()52 protected Ike3gppData() {} 53 54 /** Returns the DataType that this Ike3gppData represents. */ getDataType()55 public abstract @DataType int getDataType(); 56 } 57