12.2.2 p_info Class

This class is used as a ``glue'' to bind numeric packet type values with their symbolic names. When a new packet type is defined, its numeric code should be added to the enumeration packet_t (see ~ns/packet.h) 12.2 and its symbolic name should be added to the constructor of p_info:

enum packet_t {
        PT_TCP,
        ...
        PT_NTYPE // This MUST be the LAST one
};

class p_info {
public:
        p_info() {
                name_[PT_TCP]= "tcp";
                ...
        }
}


Tom Henderson 2011-11-05