fragroute.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* $Id$ */
  2. /*
  3. * Copyright (c) 2001 Dug Song <dugsong@monkey.org>
  4. * Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
  5. * Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
  6. *
  7. * The Tcpreplay Suite of tools is free software: you can redistribute it
  8. * and/or modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or with the authors permission any later version.
  11. *
  12. * The Tcpreplay Suite is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with the Tcpreplay Suite. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "config.h"
  21. #include "pkt.h"
  22. #ifndef __FRAGROUTE_H__
  23. #define __FRAGROUTE_H__
  24. #define FRAGROUTE_ERRBUF_LEN 1024
  25. /* Fragroute context. */
  26. struct fragroute_s {
  27. struct addr src;
  28. struct addr dst;
  29. struct addr smac;
  30. struct addr dmac;
  31. int dlt;
  32. int mtu;
  33. int first_packet; /* have we called getfragment() yet after process()? */
  34. int l2len;
  35. u_char l2header[50];
  36. // arp_t *arp;
  37. // eth_t *eth;
  38. // intf_t *intf;
  39. // route_t *route;
  40. // tun_t *tun;
  41. char errbuf[FRAGROUTE_ERRBUF_LEN];
  42. struct pktq *pktq; /* packet chain */
  43. };
  44. typedef struct fragroute_s fragroute_t;
  45. int fragroute_process(fragroute_t *ctx, void *buf, size_t len);
  46. int fragroute_getfragment(fragroute_t *ctx, char **packet);
  47. fragroute_t * fragroute_init(const int mtu, const int dlt, const char *config, char *errbuf);
  48. void fragroute_close(fragroute_t *ctx);
  49. #endif /* __FRAGROUTE_H__ */