private:
const Dictionary *a_dictionary;
- std::string a_avpName; // reference
+ AvpId a_avpId; // reference
Presence::_v a_presence;
std::string a_qual;
void _initialize(const Dictionary *d) throw() {
a_dictionary = d;
- a_avpName = "";
a_presence = Presence::None;
a_qual = "";
}
// get
- const std::string & getAvpName(void) const throw() { return a_avpName; }
+ std::string getAvpName(void) const throw();
const Presence::_v & getPresence(void) const throw() { return a_presence; }
const std::string & getQual(void) const throw() { return a_qual; }
// helpers
- AvpId getId(void) const throw();
+ AvpId getId(void) const throw() { return a_avpId; }
bool isAny(void) const throw(); // generic Avp
bool isFixed(void) const throw() { return (a_presence == Presence::Fixed); }
bool isMandatory(void) const throw() { return (a_presence == Presence::Mandatory); }
// set
void initialize(const Dictionary *d = NULL) throw() { _initialize(d); }
- void setAvpName(const std::string & an) throw() { a_avpName = an; }
+ void setAvpId(const AvpId & ai) throw() { a_avpId = ai; }
void setPresence(const Presence::_v & p) throw() { a_presence = p; }
void setQual(const std::string & q) throw(anna::RuntimeException);
};
//------------------------------------------------------------------------------
-//------------------------------------------------------------- AvpRule::getId()
+//-------------------------------------------------------- AvpRule::getAvpName()
//------------------------------------------------------------------------------
-anna::diameter::AvpId anna::diameter::stack::AvpRule::getId(void) const throw() {
- const Avp * avp = a_dictionary->getAvp(a_avpName);
- return avp->getId();
+std::string anna::diameter::stack::AvpRule::getAvpName(void) const throw() {
+ const Avp * avp = a_dictionary->getAvp(a_avpId);
+ return avp->getName();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------- AvpRule::isAny()
//------------------------------------------------------------------------------
bool anna::diameter::stack::AvpRule::isAny(void) const throw() {
- const Avp * avp = a_dictionary->getAvp(a_avpName);
+ const Avp * avp = a_dictionary->getAvp(a_avpId);
const Format * format = a_dictionary->getFormat(avp->getFormatName());
return format->isAny();
}
//------------------------------------------------------------------------------
std::string anna::diameter::stack::AvpRule::asString(bool showPair) const throw() {
std::string trace = "No Avp rule defined";
- const Avp * avp = a_dictionary->getAvp(a_avpName);
+ const Avp * avp = a_dictionary->getAvp(a_avpId);
if(avp) {
trace = a_qual;
if(isOptional()) { s_open = "["; s_close = "]"; }
trace += s_open;
- trace += a_avpName;
+ trace += getAvpName(); // anna::diameter::functions::avpIdAsPairString(a_avpId);;
trace += s_close;
if(!showPair) return trace;
// <!ELEMENT avprule EMPTY>
// <!ATTLIST avprule id CDATA #REQUIRED type (Fixed | Mandatory | Optional) #REQUIRED qual CDATA #IMPLIED>
anna::xml::Node* result = parent->createChild("avprule");
- result->createAttribute("id", a_avpName);
+ result->createAttribute("id", getAvpName());
std::string type;
if(isFixed()) type = "Fixed";
throw anna::RuntimeException(s_ex, ANNA_FILE_LOCATION);
}
- auxAvpRule.setAvpName(id);
+ auxAvpRule.setAvpId(avp->getId());
auxAvpRule.setPresence(AvpRule::Presence::asEnum(type));
auxAvpRule.setQual(qual ? (qual->getValue()) : "");
gavp->addAvpRule(auxAvpRule);
throw anna::RuntimeException(s_ex, ANNA_FILE_LOCATION);
}
- auxAvpRule.setAvpName(id);
+ auxAvpRule.setAvpId(avp->getId());
auxAvpRule.setPresence(AvpRule::Presence::asEnum(type));
auxAvpRule.setQual(qual ? (qual->getValue()) : "");
auxCommand.addAvpRule(auxAvpRule);
<!-- NOKIA VENDOR SPECIFIC CODES -->
<avp name="Nokia-Access-Method" code="5100" vendor-name="NOKIA" v-bit="must">
<single format-name="Enumerated" enum="0-3">
-<!-- No especification found for possible values. Usually we will use 3GPP-Rat-Type instead of 'Nokia-Access-Method'
+<!-- No especification found for possible values. Usually we will use 3GPP-RAT-Type instead of 'Nokia-Access-Method'
<label data="0" alias="??"/>
<label data="1" alias="??"/>
<label data="2" alias="??"/>
<avp name="3GPP-GGSN-IPv6-Address" code="16" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may"><single format-name="OctetString"/></avp>
<avp name="3GPP-SGSN-MCC-MNC" code="18" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may"><single format-name="UTF8String"/></avp>
<avp name="3GGP-IMEISV" code="20" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may"><single format-name="OctetString"/></avp>
- <avp name="3GPP-Rat-Type" code="21" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may"><single format-name="OctetString"/></avp>
+ <avp name="3GPP-RAT-Type" code="21" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may"><single format-name="OctetString"/></avp>
<avp name="3GPP-User-Location-Info" code="22" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may"><single format-name="OctetString"/></avp>
<avp name="3GPP-MS-TimeZone" code="23" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may"><single format-name="OctetString"/></avp>
<avp name="3GPP-CAMEL-Charging-Info" code="24" vendor-name="3GPP" may-encrypt="no" v-bit="must" m-bit="must" p-bit="may"><single format-name="OctetString"/></avp>
<avprule id="3GPP-Selection-Mode" type="Optional"/>
<avprule id="3GPP-Charging-Characteristics" type="Optional"/>
<avprule id="3GPP-SGSN-MCC-MNC" type="Optional"/>
- <avprule id="3GPP-Rat-Type" type="Optional"/>
+ <avprule id="3GPP-RAT-Type" type="Optional"/>
<avprule id="3GPP-User-Location-Info" type="Optional"/>
<avprule id="3GPP-MS-TimeZone" type="Optional"/>
<avprule id="3GPP-CAMEL-Charging-Info" type="Optional"/>
<avprule id="User-Equipment-Info" type="Optional"/>
<avprule id="3GPP-GGSN-MCC-MNC" type="Optional"/>
<avprule id="Filter-Id" type="Optional"/>
- <avprule id="3GPP-Rat-Type" type="Optional"/>
+ <avprule id="3GPP-RAT-Type" type="Optional"/>
</command>
<command name="Credit-Control-Answer" code="272" type="Answer">
<avprule id="Session-Id" type="Fixed"/>
<avprule id="3GPP-GPRS-Neg-QoS-Profile" type="Optional"/>
<avprule id="3GPP-GGSN-Address" type="Optional"/>
<avprule id="3GPP-SGSN-Address" type="Optional"/>
- <avprule id="3GPP-Rat-Type" type="Optional"/>
+ <avprule id="3GPP-RAT-Type" type="Optional"/>
<avprule id="3GPP-User-Location-Info" type="Optional"/>
<avprule id="3GPP-MS-TimeZone" type="Optional"/>
<avprule id="3GPP-NSAPI" type="Optional"/>
<avprule id="3GPP-NSAPI" type="Optional"/>
<avprule id="3GPP-Session-Stop-Indicator" type="Optional"/>
<avprule id="3GPP-Selection-Mode" type="Optional"/>
- <avprule id="3GPP-Rat-Type" type="Optional"/>
+ <avprule id="3GPP-RAT-Type" type="Optional"/>
<avprule id="3GPP-SGSN-MCC-MNC" type="Optional"/>
<avprule id="3GPP-User-Location-Info" type="Optional"/>
<avprule id="3GPP-MS-TimeZone" type="Optional"/>