Skip to content

Commit

Permalink
Adding 3GPP-PDP-TYPE to PS-Information protobuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeterss committed Dec 12, 2019
1 parent e760e9b commit f38963e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.ostelco.diameter.model
import org.jdiameter.api.Avp
import org.ostelco.diameter.parser.AvpField
import java.net.InetAddress
import java.util.*

/**
* PS-Information ( Avp 874 )
Expand All @@ -18,7 +19,7 @@ class PsInformation {

// 3GPP-PDP-Type ( Avp 3 )
@AvpField(Avp.TGPP_PDP_TYPE)
var pdpType: ByteArray? = null
var pdpType: Int? = null

// PDP-Address ( Avp 1227 )
@AvpField(Avp.PDP_ADDRESS)
Expand Down
14 changes: 13 additions & 1 deletion ocs-grpc-api/src/main/proto/ocs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ enum ResultCode {
DIAMETER_RATING_FAILED = 5031;
}

// 3GPP-PDP-Type #: 29.061
enum PdpType {
IPV4 = 0;
PPP = 1;
IPV6 = 2;
IPV4V6 = 3;
NON_IP = 4;
UNSTRUCTURED = 5;
ETHERNET = 6;
}

message RedirectServer {
RedirectAddressType redirectAddressType = 1;
string redirectServerAddress = 2;
Expand Down Expand Up @@ -102,7 +113,8 @@ message PsInformation {
string sgsnMccMnc = 2;
string imsiMccMnc = 3;
bytes userLocationInfo = 4;
string pdpAddress = 5;
PdpType pdpType = 5;
bytes pdpAddress = 6;
}

message ServiceInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.ostelco.diameter.model.*;
import org.ostelco.ocs.api.CreditControlRequestInfo;
import org.ostelco.ocs.api.CreditControlRequestType;
import org.ostelco.ocs.api.PdpType;
import org.ostelco.ocs.api.PsInformation;
import org.ostelco.ocs.api.ServiceInfo;
import org.ostelco.ocsgw.datasource.protobuf.GrpcDataSource;
Expand Down Expand Up @@ -162,8 +163,11 @@ private static void addPsInformation(final CreditControlContext context, CreditC
if (psInformation.getUserLocationInfo() != null) {
psInformationBuilder.setUserLocationInfo(ByteString.copyFrom(psInformation.getUserLocationInfo()));
}
if (psInformation.getPdpType() != null) {
psInformationBuilder.setPdpType(PdpType.forNumber(psInformation.getPdpType()));
}
if (psInformation.getPdpAddress() != null) {
psInformationBuilder.setPdpAddress(psInformation.getPdpAddress().getHostAddress());
psInformationBuilder.setPdpAddress(ByteString.copyFrom(psInformation.getPdpAddress().getAddress()));
}
builder.setServiceInformation(ServiceInfo.newBuilder().setPsInformation(psInformationBuilder));
}
Expand Down

0 comments on commit f38963e

Please sign in to comment.