Changeset 11a7f9c


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

Location:
libpacketdump
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/bitbuffer.c

    r4f666aa r11a7f9c  
    109109
    110110
    111 void decode_protocol_file(uint16_t link_type,char *packet,int len,element_t *el)
     111void decode_protocol_file(uint16_t link_type,const char *packet,int len,element_t *el)
    112112{
    113113    bitbuffer_t result;
  • libpacketdump/eth_2048.c

    r049e277 r11a7f9c  
    2121#define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&ip->x))
    2222
    23 void decode(int link_type,char *packet,unsigned len)
     23void decode(int link_type,const char *packet,unsigned len)
    2424{
    2525        libtrace_ip_t *ip = (libtrace_ip_t*)packet;
  • libpacketdump/eth_2054.c

    rf5d654e r11a7f9c  
    7777}
    7878       
    79 void decode(int link_type,char *packet,unsigned len)
     79void decode(int link_type,const char *packet,unsigned len)
    8080{
    8181        struct arphdr *arp = (struct arphdr*)packet;
  • libpacketdump/eth_34887.c

    r4f55f69 r11a7f9c  
    1717        } while(0)
    1818
    19 void decode(int link_type,char *packet,unsigned len)
     19void decode(int link_type,const char *packet,unsigned len)
    2020{
    2121        int offset=0;
  • libpacketdump/eth_34916.c

    r0c47bf4 r11a7f9c  
    1515} pppoe_t;
    1616
    17 void decode(int link_type, char *pkt, unsigned len)
     17void decode(int link_type,const char *pkt,unsigned len)
    1818{
    1919        pppoe_t *pppoe = (pppoe_t *) pkt;
  • libpacketdump/eth_34958.c

    r4f55f69 r11a7f9c  
    9191}
    9292
    93 void decode(int link_type,char *packet,unsigned len)
     93void decode(int link_type,const char *packet,unsigned len)
    9494{
    9595        int offset;
  • libpacketdump/grammar.h

    r4f666aa r11a7f9c  
    5151   
    5252element_t *parse_protocol_file(char *filename);
    53 void decode_protocol_file(uint16_t link_type,char *packet,int len, element_t* el);
     53void decode_protocol_file(uint16_t link_type,const char *packet,int len, element_t* el);
    5454
    5555typedef uint64_t bitbuffer_t;
  • libpacketdump/ip_1.c

    r4f55f69 r11a7f9c  
    3939};
    4040
    41 void decode(int link_type,char *packet,unsigned len)
     41void decode(int link_type,const char *packet,unsigned len)
    4242{
    4343        libtrace_icmp_t *icmp = (libtrace_icmp_t*)packet;
  • libpacketdump/ip_132.c

    r4f55f69 r11a7f9c  
    151151}
    152152
    153 void decode(int link_type,char *packet,unsigned len)
     153void decode(int link_type,const char *packet,unsigned len)
    154154{
    155155    struct sctp_common_hdr *hdr;
  • libpacketdump/ip_17.c

    r4f55f69 r11a7f9c  
    2525
    2626
    27 void decode(int link_type,char *packet,unsigned len)
     27void decode(int link_type,const char *packet,unsigned len)
    2828{
    2929        struct libtrace_udp *udp = (struct libtrace_udp*)packet;
  • libpacketdump/ip_33.c

    r4f55f69 r11a7f9c  
    4747        };
    4848
    49 void decode(int link_type,char *packet,unsigned len)
     49void decode(int link_type,const char *packet,unsigned len)
    5050{
    5151        struct dccphdr *dccp = (struct dccphdr*)packet;
  • libpacketdump/ip_47.c

    r9b06a91 r11a7f9c  
    1111} gre_t;
    1212
    13 void decode(int link_type,char *packet,unsigned len)
     13void decode(int link_type,const char *packet,unsigned len)
    1414{
    1515        // GRE
  • libpacketdump/ip_6.c

    rf5d654e r11a7f9c  
    2020#define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&tcp->x))
    2121
    22 void decode(int link_type,char *packet,unsigned len)
     22void decode(int link_type,const char *packet,unsigned len)
    2323{
    2424        unsigned char *pkt = NULL;
  • 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                        }
  • libpacketdump/libpacketdump.h

    r4f55f69 r11a7f9c  
    88
    99void trace_dump_packet(libtrace_packet_t *packet);
    10 void decode_next(char *packet,int len,char *proto_name,int type);
     10void decode_next(const char *packet,int len,const char *proto_name,int type);
    1111
    12 void decode(int link_type, char *pkt, unsigned len);
     12void decode(int link_type, const char *pkt, unsigned len);
    1313
    1414#ifdef __cplusplus
  • libpacketdump/link_0.c

    r4f55f69 r11a7f9c  
    66#include "libpacketdump.h"
    77
    8 void decode(int link_type,char *packet,unsigned len)
     8void decode(int link_type,const char *packet,unsigned len)
    99{
    1010        printf(" Legacy PoS:");
  • libpacketdump/link_10.c

    r4f55f69 r11a7f9c  
    55#include "libtrace.h"
    66
    7 void decode(int link_type,char *packet,unsigned len)
     7void decode(int link_type,const char *packet,unsigned len)
    88{
    99        // ATM
  • libpacketdump/link_11.c

    r4f55f69 r11a7f9c  
    44#include "libpacketdump.h"
    55
    6 void decode(int link_type,char *packet,unsigned len)
     6void decode(int link_type,const char *packet,unsigned len)
    77{
    88        // Ethernet - just raw ethernet frames
  • libpacketdump/link_15.c

    r3996329 r11a7f9c  
    1616        while ( (_p - _s) % sizeof(uint16_t)) {_p++; _c++;}
    1717
    18 void decode(int link_type,char *packet,unsigned len)
     18void decode(int link_type,const char *packet,unsigned len)
    1919{
    2020        uint32_t *ptr;
  • libpacketdump/link_2.c

    rf2f3327 r11a7f9c  
    77#include "libpacketdump.h"
    88
    9 void decode(int link_type,char *packet,unsigned len)
     9void decode(int link_type,const char *packet,unsigned len)
    1010{
    1111        char ether_buf[18] = {0, };
  • libpacketdump/link_4.c

    rf5d654e r11a7f9c  
    191191 * length remaining and decodes the IEs.
    192192 */
    193 static void decode_80211_information_elements(char *pkt, unsigned len) {
     193static void decode_80211_information_elements(const char *pkt, unsigned len) {
    194194        ieee80211_ie *ie;
    195195        int i = 0;
     
    425425       
    426426/* Decodes a beacon (or a probe response) */
    427 static void decode_80211_beacon(char *pkt, unsigned len) {
     427static void decode_80211_beacon(const char *pkt, unsigned len) {
    428428        ieee80211_beacon *b = (ieee80211_beacon *)pkt;
    429429        if (len < sizeof(ieee80211_beacon)) {
     
    439439}
    440440
    441 static void decode_80211_assoc_request(char *pkt, unsigned len) {
     441static void decode_80211_assoc_request(const char *pkt, unsigned len) {
    442442        ieee80211_assoc_req *a = (ieee80211_assoc_req *) pkt;
    443443       
     
    453453}
    454454
    455 static void decode_80211_assoc_response(char *pkt, unsigned len) {
     455static void decode_80211_assoc_response(const char *pkt, unsigned len) {
    456456        ieee80211_assoc_resp *r = (ieee80211_assoc_resp *) pkt;
    457457
     
    468468}
    469469       
    470 static void decode_80211_reassoc_request(char *pkt, unsigned len) {
     470static void decode_80211_reassoc_request(const char *pkt, unsigned len) {
    471471        ieee80211_reassoc_req *r = (ieee80211_reassoc_req *) pkt;
    472472
     
    482482}
    483483
    484 static void decode_80211_authentication_frame(char *pkt, unsigned len) {
     484static void decode_80211_authentication_frame(const char *pkt, unsigned len) {
    485485        ieee80211_auth *auth = (ieee80211_auth *)pkt;
    486486        if(len < sizeof(ieee80211_auth)) {
     
    497497}
    498498
    499 static void decode_80211_mgmt(char *pkt, unsigned len) {
     499static void decode_80211_mgmt(const char *pkt, unsigned len) {
    500500        ieee80211_mgmt_frame *mgmt = (ieee80211_mgmt_frame *)pkt;
    501501        uint8_t *data;
     
    580580}
    581581
    582 static void decode_80211_ctrl(char *pkt, unsigned len) {
     582static void decode_80211_ctrl(const char *pkt, unsigned len) {
    583583        ieee80211_ctrl_frame_1addr *ctrl1 = (ieee80211_ctrl_frame_1addr *) pkt;
    584584        ieee80211_ctrl_frame_2addr *ctrl2 = (ieee80211_ctrl_frame_2addr *) pkt;
     
    650650}
    651651
    652 static void decode_80211_data(char *pkt, unsigned len) {
     652static void decode_80211_data(const char *pkt, unsigned len) {
    653653        ieee80211_data_frame *data = (ieee80211_data_frame *) pkt;
    654654        ieee80211_qos_data_frame *qos = (ieee80211_qos_data_frame *)pkt;
     
    747747}
    748748
    749 void decode(int link_type, char *pkt, unsigned len)
     749void decode(int link_type, const char *pkt, unsigned len)
    750750{
    751751        ieee80211_frame_control *fc;
  • libpacketdump/link_6.c

    r4f55f69 r11a7f9c  
    1111#include "libtrace_int.h"
    1212
    13 void decode(int link_type, char *pkt, unsigned len)
     13void decode(int link_type,const char *pkt,unsigned len)
    1414{
    1515        libtrace_sll_header_t *sll = (libtrace_sll_header_t *) pkt;
Note: See TracChangeset for help on using the changeset viewer.