linuxsll_types.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_linuxsll_TYPES_H_
  19. #define _DLT_linuxsll_TYPES_H_
  20. #include "tcpedit_types.h"
  21. #include "plugins_types.h"
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /*
  26. * structure to hold any data parsed from the packet by the decoder.
  27. * Example: Ethernet VLAN tag info
  28. */
  29. typedef struct {
  30. /* dummy entry for SunPro compiler which doesn't like empty structs */
  31. int dummy;
  32. } linuxsll_extra_t;
  33. /*
  34. * FIXME: structure to hold any data in the tcpeditdlt_plugin_t->config
  35. * Things like:
  36. * - Parsed user options
  37. * - State between packets
  38. * - Note, you should only use this for the encoder function, decoder functions should place
  39. * "extra" data parsed from the packet in the tcpeditdlt_t->decoded_extra buffer since that
  40. * is available to any encoder plugin.
  41. */
  42. typedef struct {
  43. /* dummy entry for SunPro compiler which doesn't like empty structs */
  44. int dummy;
  45. } linuxsll_config_t;
  46. typedef struct {
  47. u_int16_t source; /* values 0-4 determine where the packet came and where it's going */
  48. u_int16_t type; /* linux ARPHRD_* values for link-layer device type. See:
  49. * http://www.gelato.unsw.edu.au/lxr/source/include/linux/if_arp.h
  50. */
  51. #define ARPHRD_ETHER 1 /* ethernet */
  52. u_int16_t length; /* source address length */
  53. u_char address[8]; /* first 8 bytes of source address (may be truncated) */
  54. u_int16_t proto; /* Ethernet protocol type */
  55. } linux_sll_header_t;
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif