portmap.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* $Id$ */
  2. /*
  3. * Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
  4. * Copyright (c) 2013-2018 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
  5. *
  6. * The Tcpreplay Suite of tools is free software: you can redistribute it
  7. * and/or modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation, either version 3 of the
  9. * License, or with the authors permission any later version.
  10. *
  11. * The Tcpreplay Suite is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with the Tcpreplay Suite. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include "tcpedit_types.h"
  20. #ifndef __PORTMAP_H__
  21. #define __PORTMAP_H__
  22. tcpedit_portmap_t *new_portmap();
  23. int parse_portmap(tcpedit_portmap_t **portmapdata, const char *ourstr);
  24. void free_portmap(tcpedit_portmap_t *portmap);
  25. void print_portmap(tcpedit_portmap_t *portmap);
  26. long map_port(tcpedit_portmap_t *portmap , long port);
  27. int rewrite_ipv4_ports(tcpedit_t *tcpedit, ipv4_hdr_t **ip_hdr, const int l3len);
  28. int rewrite_ipv6_ports(tcpedit_t *tcpedit, ipv6_hdr_t **ip_hdr, const int l3len);
  29. #endif