1 /* 2 * Copyright 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 com.google.android.iwlan.epdg; 18 19 import android.net.LinkAddress; 20 import android.telephony.data.NetworkSliceInfo; 21 22 import com.google.auto.value.AutoValue; 23 24 import java.net.InetAddress; 25 import java.util.List; 26 import java.util.Optional; 27 28 @AutoValue 29 public abstract class TunnelLinkProperties { internalAddresses()30 public abstract List<LinkAddress> internalAddresses(); 31 dnsAddresses()32 public abstract List<InetAddress> dnsAddresses(); 33 pcscfAddresses()34 public abstract List<InetAddress> pcscfAddresses(); 35 ifaceName()36 public abstract String ifaceName(); 37 sliceInfo()38 public abstract Optional<NetworkSliceInfo> sliceInfo(); 39 builder()40 static Builder builder() { 41 return new AutoValue_TunnelLinkProperties.Builder().setSliceInfo(Optional.empty()); 42 } 43 44 @AutoValue.Builder 45 abstract static class Builder { setInternalAddresses(List<LinkAddress> internalAddresses)46 abstract Builder setInternalAddresses(List<LinkAddress> internalAddresses); 47 setDnsAddresses(List<InetAddress> dnsAddresses)48 abstract Builder setDnsAddresses(List<InetAddress> dnsAddresses); 49 setPcscfAddresses(List<InetAddress> pcscfAddresses)50 abstract Builder setPcscfAddresses(List<InetAddress> pcscfAddresses); 51 setIfaceName(String ifaceName)52 abstract Builder setIfaceName(String ifaceName); 53 setSliceInfo(NetworkSliceInfo si)54 public Builder setSliceInfo(NetworkSliceInfo si) { 55 return setSliceInfo(Optional.ofNullable(si)); 56 } 57 setSliceInfo(Optional<NetworkSliceInfo> si)58 abstract Builder setSliceInfo(Optional<NetworkSliceInfo> si); 59 build()60 abstract TunnelLinkProperties build(); 61 } 62 } 63