Ignore:
Timestamp:
05/08/08 14:42:03 (13 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
1f44884
Parents:
89404f5
Message:

Constification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/libpacketdump.cc

    r0aae8f4 r11a7f9c  
    5555};
    5656
    57 typedef void (*decode_norm_t)(uint16_t type,char *packet,int len);
    58 typedef void (*decode_parser_t)(uint16_t type,char *packet,int len, element_t* el);
     57typedef void (*decode_norm_t)(uint16_t type,const char *packet,int len);
     58typedef void (*decode_parser_t)(uint16_t type,const char *packet,int len, element_t* el);
    5959
    6060typedef union decode_funcs {
     
    8484        libtrace_linktype_t linktype;
    8585        uint32_t length;
    86         char *link=(char *)trace_get_packet_buffer(packet,&linktype,&length);
     86        const char *link=(char *)trace_get_packet_buffer(packet,&linktype,&length);
    8787
    8888        printf("\n%s",ctime(&sec));
     
    9898}
    9999
    100 static void generic_decode(uint16_t type,char *packet, int len) {
     100static void generic_decode(uint16_t type,const char *packet, int len) {
    101101        int i;
    102102        printf(" Unknown Protocol: %i",type);
     
    128128}
    129129
    130 void decode_next(char *packet,int len,char *proto_name,int type)
     130void decode_next(const char *packet,int len,const char *proto_name,int type)
    131131{
    132132        std::string sname(proto_name);
     
    187187                        uint16_t newtype;
    188188                        uint32_t newlen=len;
    189                         void *network=trace_get_payload_from_link(packet,
     189                        const char *network=(const char*)trace_get_payload_from_link((void*)packet,
    190190                                        (libtrace_linktype_t)type,
    191191                                        &newtype,&newlen);
    192192                        if (network) {
    193193                                printf("skipping unknown link header of type %i to %i\n",type,newtype);
    194                                 decode_next((char*)network,newlen,"eth",newtype);
     194                                decode_next(network,newlen,"eth",newtype);
    195195                                return;
    196196                        }
Note: See TracChangeset for help on using the changeset viewer.