head 1.4; access; symbols; locks mouse:1.4; strict; comment @ * @; 1.4 date 2010.02.25.05.45.57; author mouse; state Exp; branches; next 1.3; 1.3 date 2010.02.23.22.20.59; author mouse; state Exp; branches; next 1.2; 1.2 date 2010.02.18.03.11.54; author mouse; state Exp; branches; next 1.1; 1.1 date 2010.02.18.02.58.56; author mouse; state Exp; branches; next ; desc @ext-BIG-REQUESTS.c @ 1.4 log @Add padding calls where tests show the need for them. @ text @#include #include "ext.h" #include "fmt-util.h" static int match_big_requests(const char *name, int len) { return((len==12)&&!bcmp(name,"BIG-REQUESTS",12)); } static void xtoc_big_requests_BigReqEnable(FLOW *f, FILE *o, void *pv __attribute__((__unused__))) { unsigned int max; if (! f) return; rep_hdr(f,o,"BIG-REQUESTS BigReqEnable"); EXACTLENGTH(32); get_pad(f,1,1); max = get4u(f,8); fprintf(o," Max-request-length: %u (%u bytes)",max,max*4); if (max <= f->conn->maxreq) { fprintf(o," (INVALID)"); } else { set_big_requests(f->conn,max); } fprintf(o,"\n"); get_pad(f,12,20); } static void request_big_requests(FLOW *f, FILE *o) { switch (get1u(f,1)) { case 0: req_hdr_exact(f,o,"BIG-REQUESTS BigReqEnable",4); expect_reply(f->conn,&xtoc_big_requests_BigReqEnable,0); break; default: fprintf(o,"Impossible BIG-REQUESTS request %u",get1u(f,1)); print_raw_data(o,f); abort_packet_print(); break; } } static void event_big_requests(FLOW *f, FILE *o) { fprintf(o,"Impossible BIG-REQUESTS event %u",get1u(f,0)); print_raw_data(o,f); abort_packet_print(); } static void error_big_requests(FLOW *f, FILE *o) { fprintf(o,"Impossible BIG-REQUESTS error %u",get1u(f,1)); print_raw_data(o,f); abort_packet_print(); } EXTDEF extdef_big_requests = { "BIG-REQUESTS", &match_big_requests, &request_big_requests, &event_big_requests, &error_big_requests }; @ 1.3 log @Add the BIG-REQUESTS name to output; add _big_requests_ to routine name. @ text @d18 1 d28 1 @ 1.2 log @Add BIG-REQUESTS support. Builds, but, until I find a way to deliberately do huge requests, untested. @ text @d11 1 a11 1 static void xtoc_BigReqEnable(FLOW *f, FILE *o, void *pv __attribute__((__unused__))) d16 1 a16 1 rep_hdr(f,o,"BigReqEnable"); d33 2 a34 2 req_hdr_exact(f,o,"BigReqEnable",4); expect_reply(f->conn,&xtoc_BigReqEnable,0); @ 1.1 log @Initial revision @ text @d1 63 @