user_types.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* $Id$ */
  2. /*
  3. * Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
  4. *
  5. * The Tcpreplay Suite of tools is free software: you can redistribute it
  6. * and/or modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation, either version 3 of the
  8. * License, or with the authors permission any later version.
  9. *
  10. * The Tcpreplay Suite is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with the Tcpreplay Suite. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef _DLT_user_TYPES_H_
  19. #define _DLT_user_TYPES_H_
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. typedef enum {
  24. TCPEDIT_USER_DLT_BOTH,
  25. TCPEDIT_USER_DLT_S2C,
  26. TCPEDIT_USER_DLT_C2S
  27. } tcpedit_user_dlt_direction;
  28. /*
  29. * FIXME: structure to hold any data parsed from the packet by the decoder.
  30. * Example: Ethernet VLAN tag info
  31. */
  32. typedef struct {
  33. /* dummy entry for SunPro compiler which doesn't like empty structs */
  34. int dummy;
  35. } user_extra_t;
  36. #define USER_L2MAXLEN 255
  37. /*
  38. * FIXME: structure to hold any data in the tcpeditdlt_plugin_t->config
  39. * Things like:
  40. * - Parsed user options
  41. * - State between packets
  42. * - Note, you should only use this for the encoder function, decoder functions should place
  43. * "extra" data parsed from the packet in the tcpeditdlt_t->decoded_extra buffer since that
  44. * is available to any encoder plugin.
  45. */
  46. typedef struct {
  47. u_int16_t dlt;
  48. int length;
  49. u_char l2client[USER_L2MAXLEN];
  50. u_char l2server[USER_L2MAXLEN];
  51. } user_config_t;
  52. #ifdef __cplusplus
  53. }
  54. #endif
  55. #endif