Author: axel Date: 2009-09-15 19:24:14 +0000 (Tue, 15 Sep 2009) New Revision: 1438
Modified: trunk/batman-experimental/batman.h trunk/batman-experimental/lib/bmx_http_info/http_info.c trunk/batman-experimental/schedule.c Log: let http_info plugin respond with simple help page to invalid http requests, some other minor changes
Modified: trunk/batman-experimental/batman.h =================================================================== --- trunk/batman-experimental/batman.h 2009-09-15 19:22:26 UTC (rev 1437) +++ trunk/batman-experimental/batman.h 2009-09-15 19:24:14 UTC (rev 1438) @@ -230,8 +230,6 @@ #define ARG_NETB "netb"
- - #define ARG_THROW "throw"
@@ -315,8 +313,6 @@ } __attribute__((packed));
-#define OGM_OGI_MAX 255 - struct bat_packet_ogm { #if __BYTE_ORDER == __LITTLE_ENDIAN @@ -381,8 +377,8 @@ #define EXT_FIELD_TYPE ext_type #define EXT_FIELD_MSG ext_msg
-#define EXT_FIELD_LEN def8 /* the size of this TLV extension header in 4 oktet blocks (including this first 4 oktets) */ -#define MIN_TLV_LEN_BYTES 4 /* the minimum size in bytes (1 octet) of a TLV extension message */ +#define EXT_FIELD_LEN_4B def8 /* the size of this TLV extension header in 4 oktet blocks (including this first 4 oktets) */ +#define MIN_TLV_LEN_1B 4 /* the minimum size in bytes (1 octet) of a TLV extension message */ // field accessor for primary interface announcement extension packets #define EXT_PIP_FIELD_RES1 def8
Modified: trunk/batman-experimental/lib/bmx_http_info/http_info.c =================================================================== --- trunk/batman-experimental/lib/bmx_http_info/http_info.c 2009-09-15 19:22:26 UTC (rev 1437) +++ trunk/batman-experimental/lib/bmx_http_info/http_info.c 2009-09-15 19:24:14 UTC (rev 1438) @@ -86,9 +86,32 @@ } else { - dbgf( DBGL_CHANGES, DBGT_INFO, "rcvd illegal %d bytes long HTTP request via fd %d", + dbg( DBGL_CHANGES, DBGT_INFO, "rcvd illegal %d bytes long HTTP request via fd %d", tcp_req_len, cn->fd); + /* + dbg_cn( cn, DBGL_ALL, DBGT_INFO, "rcvd illegal %d bytes long HTTP request via fd %d:\n%s\n", + tcp_req_len, cn->fd, tcp_req_data); + */ + check_apply_parent_option( ADD, OPT_APPLY, 0, get_option( 0,0, ARG_STATUS), 0, cn ); + dbg_printf( cn, "\nillegal HTTP request! Valid requests are:\n\n" ); + + struct list_head *list_pos; + + list_for_each( list_pos, &opt_list ) { + + struct opt_type *opt = (struct opt_type *)list_entry( list_pos, struct opt_data, list ); + + if ( opt->auth_t == A_USR && + opt->opt_t == A_PS0 && + opt->dyn_t != A_INI && + opt->cfg_t == A_ARG ) + { + dbg_printf( cn, "/%s\n\n", opt->long_name ); + + } + } + } } else {
Modified: trunk/batman-experimental/schedule.c =================================================================== --- trunk/batman-experimental/schedule.c 2009-09-15 19:22:26 UTC (rev 1437) +++ trunk/batman-experimental/schedule.c 2009-09-15 19:24:14 UTC (rev 1438) @@ -845,7 +845,7 @@ if ( ((struct ext_packet*)(ext_a+ext_p))->EXT_FIELD_TYPE == ext_type ) { if ( ext_attribute[ext_type] & EXT_ATTR_TLV ) - ext_p+= 4*((struct ext_packet*)(ext_a+ext_p))->EXT_FIELD_LEN; + ext_p+= 4*((struct ext_packet*)(ext_a+ext_p))->EXT_FIELD_LEN_4B; else ext_p+= sizeof(struct ext_packet);