inet-3.6.4/src/inet/networklayer/rsvp_te/SimpleClassifier.cc
// IClassifier implementation (method invoked by MPLS)
IClassifier implementation (method invoked by MPLS)
IClassifier implementation ( method invoked by MPLS )
bool SimpleClassifier::lookupLabel(IPv4Datagram *ipdatagram, LabelOpVector& outLabel, std::string& outInterface, int& color)
{
    switch (ipdatagram->getTransportProtocol()) {
        case IP_PROT_OSPF:
        case IP_PROT_RSVP:
            return false;
        default:
            break;
    }
    for (auto & elem : bindings) {
        if (!elem.dest.isUnspecified() && !elem.dest.equals(ipdatagram->getDestAddress()))
            continue;
        if (!elem.src.isUnspecified() && !elem.src.equals(ipdatagram->getSrcAddress()))
            continue;
        EV_DETAIL << "packet belongs to fecid=" << elem.id << endl;
        if (elem.inLabel < 0)
            return false;
        return lt->resolveLabel("", elem.inLabel, outLabel, outInterface, color);
    }
    return false;
}
bool SimpleClassifier :: lookupLabel ( IPv4Datagram * ipdatagram , LabelOpVector & outLabel , std :: string & outInterface , int & color ) { switch ( ipdatagram -> getTransportProtocol ( ) ) { case IP_PROT_OSPF : case IP_PROT_RSVP : return false ; default : break ; } for ( auto & elem : bindings ) { if ( ! elem . dest . isUnspecified ( ) && ! elem . dest . equals ( ipdatagram -> getDestAddress ( ) ) ) continue ; if ( ! elem . src . isUnspecified ( ) && ! elem . src . equals ( ipdatagram -> getSrcAddress ( ) ) ) continue ; EV_DETAIL << " " << elem . id << endl ; if ( elem . inLabel < 0 ) return false ; return lt -> resolveLabel ( " " , elem . inLabel , outLabel , outInterface , color ) ; } return false ; }
IClassifier implementation (method invoked by MPLS)
IClassifier implementation ( method invoked by MPLS )
// never label OSPF(TED) and RSVP traffic // forwarding decision for non-labeled datagrams