1 /**************************************************************************** 2 ** File: display.h 3 ** 4 ** Author: Mike Borella 5 ** 6 ** Comments: Header file for displaying functions 7 ** 8 ** $Id: display.h,v 1.23 2006/11/21 07:47:33 farooq-i-azam Exp $ 9 ** 10 ** This program is free software; you can redistribute it and/or modify 11 ** it under the terms of the GNU General Public License as published by 12 ** the Free Software Foundation; either version 2 of the License, or 13 ** (at your option) any later version. 14 ** 15 ** This program is distributed in the hope that it will be useful, 16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 ** GNU Library General Public License for more details. 19 ** 20 ** You should have received a copy of the GNU General Public License 21 ** along with this program; if not, write to the Free Software 22 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 23 ** 24 *****************************************************************************/ 25 26 #ifndef DISPLAY_H 27 #define DISPLAY_H 28 29 #include "global.h" 30 #include "strmap.h" 31 #include "utilities.h" 32 #include "layers.h" 33 #include "error.h" 34 35 36 /* 37 * Display format types 38 */ 39 40 typedef enum display 41 { 42 DISP_DEC, /* Display and arbitrary decimal value */ 43 DISP_BIN, /* Binary format with leading 0's (01101110) */ 44 DISP_BINNLZ, /* Binary format w/o leading 0's (1101110) */ 45 DISP_HEX, /* 2 bytes, hex (0F) */ 46 DISP_HEX_MULTILINE, /* Hex output spanning more than one line */ 47 DISP_HEXCOLONS, /* Hex bytes separated by colons (0F:7A:B1) */ 48 DISP_HEXCOLONS4, /* 4 Hex bytes between colons */ 49 DISP_DOTTEDDEC, /* Dotted decimal (IP address) format (4 bytes only) */ 50 DISP_STRING, /* Plain old ascii string */ 51 DISP_STRING_MULTILINE /* String output spanning more than one line */ 52 } display_t; 53 54 /* 55 * Header line types 56 */ 57 58 typedef enum headerline 59 { 60 HEADERLINE_DASHES, 61 HEADERLINE_STARS, 62 HEADERLINE_EQUALS, 63 HEADERLINE_DOTS, 64 } headerline_t; 65 66 /* 67 * Function prototypes 68 */ 69 70 inline void display_header_line (headerline_t); 71 inline void display_header_banner (char *); 72 inline void display_header_banner_ts(char *, char *); 73 inline void display (char *, u_int8_t *, u_int32_t, display_t); 74 inline void display_string (u_int8_t *, u_int8_t *); 75 inline void display_strmap(char *, int, strmap_t *map); 76 inline void display_strmap_hex(char *, int, strmap_t *map); 77 inline void display_ipv4 (u_int8_t *, u_int8_t *); 78 inline void display_ipv6 (u_int8_t *, u_int8_t *); 79 inline void display_minimal (u_int8_t *, u_int32_t, display_t); 80 inline void display_minimal_string (u_int8_t *); 81 inline void display_minimal_ipv4 (u_int8_t *); 82 inline void display_minimal_ipv6 (u_int8_t *); 83 inline void display_minimal_cr(void); 84 85 #endif 86