package com.jihe.punchnet import android.os.Parcel import android.os.Parcelable import com.jihe.punchnet.data.RouteItem data class RouteInfo( // 192.168.80.0/24 val targetNetCIDR: String, // 10.167.69.2 val gateway: String, ) data class PunchnetServiceArgument( val token: String, val routes: Array, ): Parcelable { override fun writeToParcel(dest: Parcel, flags: Int) { dest.writeString(token) dest.writeInt(routes.size) routes.forEach { item -> dest.writeLong(item.id) dest.writeInt(item.net_ip) dest.writeInt(item.mask_ip) dest.writeInt(item.gateway) } } override fun describeContents(): Int { return 0 } companion object CREATOR: Parcelable.Creator { override fun createFromParcel(source: Parcel): PunchnetServiceArgument { val token = source.readString()!! val size = source.readInt() var routes = mutableListOf() for (i in 0.. { return arrayOfNulls(size) } } }