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.NonNull; 20 import android.annotation.SystemApi; 21 22 import java.util.Objects; 23 24 /** 25 * Ike3gppN1ModeInformation represents the data provided by the peer/remote endpoint for an 26 * N1_MODE_INFORMATION Notify payload. 27 * 28 * @see 3GPP TS 24.302 Section 8.2.9.16 N1_MODE_INFORMATION Notify payload 29 * @hide 30 */ 31 @SystemApi 32 public final class Ike3gppN1ModeInformation extends Ike3gppData { 33 private final byte[] mSnssai; 34 35 /** 36 * Constructs an Ike3gppN1ModeInformation with the specified parameters. 37 * 38 * @param snssai the SNSSAI value indicated by the peer 39 * @hide 40 */ 41 @SystemApi Ike3gppN1ModeInformation(@onNull byte[] snssai)42 public Ike3gppN1ModeInformation(@NonNull byte[] snssai) { 43 Objects.requireNonNull(snssai, "snssai must not be null"); 44 mSnssai = snssai.clone(); 45 } 46 47 @Override getDataType()48 public @DataType int getDataType() { 49 return DATA_TYPE_NOTIFY_N1_MODE_INFORMATION; 50 } 51 52 /** 53 * Returns the S-NSSAI value reported by the peer. 54 * 55 * <p>The S-NSSAI is coded as defined in 3GPP TS 24.501 Section 9.11.2.8. 56 */ 57 @NonNull getSnssai()58 public byte[] getSnssai() { 59 return mSnssai.clone(); 60 } 61 } 62