Commit b341745a authored by Rohan's avatar Rohan Committed by Rohan

IE UPF Features - handling additional optional fields

parent 2308605a
......@@ -703,7 +703,39 @@ struct up_function_features_s {
uint16_t quoac : 1;
uint16_t trace : 1;
uint16_t frrt : 1;
uint16_t spare : 2;
// uint16_t spare : 2;
uint16_t pfde : 1;
uint16_t epfar : 1;
uint16_t dpdra : 1;
uint16_t adpdp : 1;
uint16_t ueip : 1;
uint16_t sset : 1;
uint8_t mnop : 1;
uint8_t mte : 1;
uint8_t bundl : 1;
uint8_t gcom : 1;
uint8_t mpas : 1;
uint8_t rttl : 1;
uint8_t vtime : 1;
uint8_t norp : 1;
uint8_t iptv : 1;
uint8_t ip6pl : 1;
uint8_t tscu : 1;
uint8_t mptcp : 1;
uint8_t atsss_ll : 1;
uint8_t qfqm : 1;
uint8_t gpqm : 1;
uint8_t mt_edt : 1;
uint8_t ciot : 1;
uint8_t ethar : 1;
uint8_t ddds : 1;
uint8_t rds : 1;
uint8_t rttwp : 1;
uint8_t spare : 7;
// up_function_features_s& operator=(up_function_features_s i)
//{
......@@ -719,12 +751,44 @@ struct up_function_features_s {
pfdm(0),
heeu(0),
treu(0),
empu(0),
pdiu(0),
udbc(0),
quoac(0),
trace(0),
frrt(0),
pfde(0),
epfar(0),
dpdra(0),
adpdp(0),
ueip(0),
sset(0),
mnop(0),
mte(0),
bundl(0),
gcom(0),
mpas(0),
rttl(0),
vtime(0),
norp(0),
iptv(0),
ip6pl(0),
tscu(0),
mptcp(0),
atsss_ll(0),
qfqm(0),
gpqm(0),
mt_edt(0),
ciot(0),
ethar(0),
ddds(0),
rds(0),
rttwp(0),
spare(0) {}
up_function_features_s(const up_function_features_s& i) {
......@@ -744,6 +808,37 @@ struct up_function_features_s {
trace = i.trace;
frrt = i.frrt;
spare = i.spare;
epfar = i.epfar;
pfde = i.pfde;
dpdra = i.dpdra;
adpdp = i.adpdp;
ueip = i.ueip;
sset = i.sset;
mnop = i.mnop;
mte = i.mte;
bundl = i.bundl;
gcom = i.gcom;
mpas = i.mpas;
rttl = i.rttl;
vtime = i.vtime;
norp = i.norp;
iptv = i.iptv;
ip6pl = i.ip6pl;
tscu = i.tscu;
mptcp = i.mptcp;
atsss_ll = i.atsss_ll;
qfqm = i.qfqm;
gpqm = i.gpqm;
mt_edt= i.mt_edt;
ciot = i.ciot;
ethar = i.ethar;
ddds = i.ddds;
rds = i.rds;
rttwp = i.rttwp;
}
};
// typedef struct up_function_features_s up_function_features_t;
......
......@@ -2220,16 +2220,70 @@ class pfcp_up_function_features_ie : public pfcp_ie {
uint8_t quoac : 1;
uint8_t trace : 1;
uint8_t frrt : 1;
uint8_t spare : 2;
// uint8_t spare : 2;
uint8_t pfde : 1;
uint8_t epfar : 1;
} bf;
uint8_t b;
} u2;
union {
struct {
uint8_t dpdra : 1;
uint8_t adpdp : 1;
uint8_t ueip : 1;
uint8_t sset : 1;
uint8_t mnop : 1;
uint8_t mte : 1;
uint8_t bundl : 1;
uint8_t gcom : 1;
} bf;
uint8_t b;
} u3;
union {
struct {
uint8_t mpas : 1;
uint8_t rttl : 1;
uint8_t vtime : 1;
uint8_t norp : 1;
uint8_t iptv : 1;
uint8_t ip6pl : 1;
uint8_t tscu : 1;
uint8_t mptcp : 1;
} bf;
uint8_t b;
} u4;
union {
struct {
uint8_t atsss_ll : 1;
uint8_t qfqm : 1;
uint8_t gpqm : 1;
uint8_t mt_edt : 1;
uint8_t ciot : 1;
uint8_t ethar : 1;
uint8_t ddds : 1;
uint8_t rds : 1;
} bf;
uint8_t b;
} u5;
union {
struct {
uint8_t rttwp : 1;
uint8_t spare : 7;
} bf;
uint8_t b;
} u6;
//--------
explicit pfcp_up_function_features_ie(const pfcp::up_function_features_s& b)
: pfcp_ie(PFCP_IE_UP_FUNCTION_FEATURES) {
u1.b = 0;
u2.b = 0;
u3.b = 0;
u4.b = 0;
u5.b = 0;
u6.b = 0;
u1.bf.bucp = b.bucp;
u1.bf.ddnd = b.ddnd;
u1.bf.dlbd = b.dlbd;
......@@ -2245,18 +2299,61 @@ class pfcp_up_function_features_ie : public pfcp_ie {
u2.bf.quoac = b.quoac;
u2.bf.trace = b.trace;
u2.bf.frrt = b.frrt;
tlv.set_length(2);
u2.bf.pfde = b.pfde;
u2.bf.epfar = b.epfar;
u3.bf.dpdra = b.dpdra;
u3.bf.adpdp = b.adpdp;
u3.bf.ueip = b.ueip;
u3.bf.sset = b.sset;
u3.bf.mnop = b.mnop;
u3.bf.mte = b.mte;
u3.bf.bundl = b.bundl;
u3.bf.gcom = b.gcom;
u4.bf.mpas = b.mpas;
u4.bf.rttl = b.rttl;
u4.bf.vtime = b.vtime;
u4.bf.norp = b.norp;
u4.bf.iptv = b.iptv;
u4.bf.ip6pl = b.ip6pl;
u4.bf.tscu = b.tscu;
u4.bf.mptcp = b.mptcp;
u5.bf.atsss_ll = b.atsss_ll;
u5.bf.qfqm = b.qfqm;
u5.bf.gpqm = b.gpqm;
u5.bf.mt_edt= b.mt_edt;
u5.bf.ciot = b.ciot;
u5.bf.ethar = b.ethar;
u5.bf.ddds = b.ddds;
u5.bf.rds = b.rds;
u6.bf.rttwp = b.rttwp;
// tlv.set_length(2);
tlv.set_length(6);
}
//--------
pfcp_up_function_features_ie() : pfcp_ie(PFCP_IE_UP_FUNCTION_FEATURES) {
u1.b = 0;
u2.b = 0;
tlv.set_length(2);
u3.b = 0;
u4.b = 0;
u5.b = 0;
u6.b = 0;
// tlv.set_length(2);
tlv.set_length(6);
}
//--------
explicit pfcp_up_function_features_ie(const pfcp_tlv& t) : pfcp_ie(t) {
u1.b = 0;
u2.b = 0;
u3.b = 0;
u4.b = 0;
u5.b = 0;
u6.b = 0;
};
//--------
void to_core_type(pfcp::up_function_features_s& b) {
......@@ -2275,24 +2372,68 @@ class pfcp_up_function_features_ie : public pfcp_ie {
b.quoac = u2.bf.quoac;
b.trace = u2.bf.trace;
b.frrt = u2.bf.frrt;
// b.spare = 0;
b.pfde = u2.bf.pfde;
b.epfar = u2.bf.epfar;
b.dpdra = u3.bf.dpdra;
b.adpdp = u3.bf.adpdp;
b.ueip = u3.bf.ueip;
b.sset = u3.bf.sset;
b.mnop = u3.bf.mnop;
b.mte = u3.bf.mte;
b.bundl = u3.bf.bundl;
b.gcom = u3.bf.gcom;
b.mpas = u4.bf.mpas;
b.rttl = u4.bf.rttl;
b.vtime = u4.bf.vtime;
b.norp = u4.bf.norp;
b.iptv = u4.bf.iptv;
b.ip6pl = u4.bf.ip6pl;
b.tscu = u4.bf.tscu;
b.mptcp = u4.bf.mptcp;
b.atsss_ll = u5.bf.atsss_ll;
b.qfqm = u5.bf.qfqm;
b.gpqm = u5.bf.gpqm;
b.mt_edt= u5.bf.mt_edt;
b.ciot = u5.bf.ciot;
b.ethar = u5.bf.ethar;
b.ddds = u5.bf.ddds;
b.rds = u5.bf.rds;
b.rttwp = u6.bf.rttwp;
b.spare = 0;
}
//--------
void dump_to(std::ostream& os) {
tlv.set_length(2);
// tlv.set_length(2);
tlv.set_length(6);
tlv.dump_to(os);
os.write(reinterpret_cast<const char*>(&u1.b), sizeof(u1.b));
os.write(reinterpret_cast<const char*>(&u2.b), sizeof(u2.b));
os.write(reinterpret_cast<const char*>(&u3.b), sizeof(u3.b));
os.write(reinterpret_cast<const char*>(&u4.b), sizeof(u4.b));
os.write(reinterpret_cast<const char*>(&u5.b), sizeof(u5.b));
os.write(reinterpret_cast<const char*>(&u6.b), sizeof(u6.b));
}
//--------
void load_from(std::istream& is) {
// tlv.load_from(is);
if (tlv.get_length() != 2) {
// if (tlv.get_length() != 2) {
if (tlv.get_length() != 6) {
throw pfcp_tlv_bad_length_exception(
tlv.type, tlv.get_length(), __FILE__, __LINE__);
}
is.read(reinterpret_cast<char*>(&u1.b), sizeof(u1.b));
is.read(reinterpret_cast<char*>(&u2.b), sizeof(u2.b));
is.read(reinterpret_cast<char*>(&u3.b), sizeof(u3.b));
is.read(reinterpret_cast<char*>(&u4.b), sizeof(u4.b));
is.read(reinterpret_cast<char*>(&u5.b), sizeof(u5.b));
is.read(reinterpret_cast<char*>(&u6.b), sizeof(u6.b));
}
//--------
void to_core_type(pfcp_ies_container& s) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment