next up previous contents index
Next: 11.2.3 The hdr_cmn Class Up: 11.2 Packet Classes Previous: 11.2.1 The Packet Class

   
11.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 packet.h) 11.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";
                ...
        }
}



2000-08-24