head 1.10; access; symbols; locks mouse:1.10; strict; comment @ * @; 1.10 date 2010.02.25.05.45.57; author mouse; state Exp; branches; next 1.9; 1.9 date 2010.02.25.05.28.11; author mouse; state Exp; branches; next 1.8; 1.8 date 2010.02.25.02.44.44; author mouse; state Exp; branches; next 1.7; 1.7 date 2010.02.25.02.27.19; author mouse; state Exp; branches; next 1.6; 1.6 date 2010.02.23.22.53.52; author mouse; state Exp; branches; next 1.5; 1.5 date 2010.02.23.22.28.58; author mouse; state Exp; branches; next 1.4; 1.4 date 2010.02.18.03.11.54; author mouse; state Exp; branches; next 1.3; 1.3 date 2010.02.18.03.08.52; author mouse; state Exp; branches; next 1.2; 1.2 date 2010.02.16.16.11.33; author mouse; state Exp; branches; next 1.1; 1.1 date 2010.02.16.06.29.39; author mouse; state Exp; branches; next ; desc @fmt-util.h @ 1.10 log @Add padding calls where tests show the need for them. @ text @#ifndef _FMT_UTIL_H_f3691b2c_ #define _FMT_UTIL_H_f3691b2c_ #include #include "sets.h" #include "structs.h" #define XID_FMT "<0x%08x>" extern void print_raw_data(FILE *, FLOW *); extern void get_init(FLOW *); extern void get_clear(FLOW *); extern void get_disable(FLOW *); extern unsigned int get1u(FLOW *, unsigned int); extern unsigned int get2u(FLOW *, unsigned int); extern unsigned int get4u(FLOW *, unsigned int); extern int get1s(FLOW *, unsigned int); extern int get2s(FLOW *, unsigned int); extern int get4s(FLOW *, unsigned int); extern void get_pad(FLOW *, unsigned int, unsigned int); extern void get_done(FLOW *, FILE *); extern void get_free(FLOW *); extern unsigned int ltob_u(unsigned int); extern int ltob_s(unsigned int); extern unsigned int ltos_u(unsigned int); extern int ltos_s(unsigned int); extern void print_xid_z(FILE *, unsigned int, const char *); extern void print_xid_alt(FILE *, unsigned int, int, ...); extern void print_set(FILE *, const char *, const char *, unsigned int, const SETVALS *); extern void print_set_alt(FILE *, const char *, const char *, unsigned int, const SETVALS *, int, ...); extern unsigned int bitcount(unsigned int v); extern void print_text_blk(FLOW *, FILE *, unsigned int, int, const char *, const char *); extern void print_padded_text_blk(FLOW *, FILE *, unsigned int, int, const char *, const char *); extern void print_bin_blk(FLOW *, FILE *, unsigned int, int, const char *, const char *); extern unsigned int pad(unsigned int); extern unsigned int padded(unsigned int); extern void *copy_block(const void *, int); extern void print_atom(FILE *, CONN *, unsigned int); extern void print_atom_z(FILE *, CONN *, unsigned int, const char *); extern void print_timestamp(FILE *, unsigned int); extern void print_choice(FILE *, unsigned int, int, ...); extern void minlength(FLOW *, FILE *, unsigned int); #define MINLENGTH(l) minlength(f,o,(l)) extern void exactlength(FLOW *, FILE *, unsigned int); #define EXACTLENGTH(l) exactlength(f,o,(l)) extern void rep_hdr(FLOW *, FILE *, const char *); extern void req_hdr_min(FLOW *, FILE *, const char *, int); extern void req_hdr_exact(FLOW *, FILE *, const char *, int); extern void event_hdr(FLOW *, FILE *, const char *); extern void error_hdr(FLOW *, FILE *, const char *); /* actually in xscope.c */ extern void set_eof(FLOW *); extern void abort_packet_print(void); extern void expect_reply(CONN *, void (*xtocfn)(FLOW *, FILE *, void *), void *); extern void expect_another_reply(CONN *, unsigned int, void (*xtocfn)(FLOW *, FILE *, void *), void *); extern int format_event(FLOW *, FILE *); extern void ext_values(FLOW *, FILE *, const char *, int, unsigned char, unsigned char, unsigned char, unsigned char); extern void set_big_requests(CONN *, unsigned int); #endif @ 1.9 log @Add get_disable(), to mark the buffer-checking machinery disabled for this packet, and use it where appropriate. @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_3be7ffcf_ #define _FMT_UTIL_H_3be7ffcf_ d34 1 @ 1.8 log @Add checking that all bytes in packets are accounted for and none used multiple times with inconsistent sizes. This should catch most of the worst of botched packet parsing bugs. @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_c8e008d5_ #define _FMT_UTIL_H_c8e008d5_ d14 1 @ 1.7 log @Type the offset arg to get[124][su] as unsigned, which it really is. This also means removing <0 checks. @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_056779de_ #define _FMT_UTIL_H_056779de_ d12 2 d20 3 d32 2 a33 2 extern void print_text_blk(FILE *, const unsigned char *, int, const char *, const char *); extern void print_bin_blk(FILE *, const unsigned char *, int, const char *, const char *); @ 1.6 log @Create XID_FMT and use it for printing XIDs. @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_5634cf78_ #define _FMT_UTIL_H_5634cf78_ d12 6 a17 6 extern unsigned int get1u(FLOW *, int); extern unsigned int get2u(FLOW *, int); extern unsigned int get4u(FLOW *, int); extern int get1s(FLOW *, int); extern int get2s(FLOW *, int); extern int get4s(FLOW *, int); @ 1.5 log @Move event_hdr and error_hdr from fmt-core.c statics to fmt-util.c globals. This is preparatory to their use by extensions. @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_e1bab96c_ #define _FMT_UTIL_H_e1bab96c_ d8 2 @ 1.4 log @Add BIG-REQUESTS support. Builds, but, until I find a way to deliberately do huge requests, untested. @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_3040a00d_ #define _FMT_UTIL_H_3040a00d_ d41 2 @ 1.3 log @Move minlength, exactlength, rep_hdr, req_hdr_min, req_hdr_exact to fmt-util.c, for use by more than just core. @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_36f11f75_ #define _FMT_UTIL_H_36f11f75_ d49 1 @ 1.2 log @New extension framework. No extensions actually implemented yet. @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_6781d454_ #define _FMT_UTIL_H_6781d454_ d34 7 @ 1.1 log @Initial revision @ text @d1 2 a2 2 #ifndef _FMT_UTIL_H_d09c1a61_ #define _FMT_UTIL_H_d09c1a61_ d41 1 @