README 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. This code is heavily based on, even stolen from Dug Song's excellent fragroute
  2. utility. I've taken a perfectly good application and converted it into a
  3. packet editing library for my own needs. Any bugs are my fault. Any praises
  4. really should go to Dug.
  5. Please consider all files here under the original fragroute LICENSE, with the
  6. added caveat that any changes are:
  7. Copyright 2008, Aaron Turner
  8. Notes:
  9. Fragroute runs as a daemon which intercepts packets by modifying the host
  10. operating systems routing table, redirecting packets destined to the target
  11. IP over the loopback interface. Packets reaching the loopback interface
  12. are then read using libpcap/BPF filter processed according to the fragroute
  13. rule set and then resent out the configured interface.
  14. libfragroute works differently. First, we do away with any changes to the
  15. host routing table. Secondly, packets are not sent out any interface, but
  16. are read back by the caller. The API should look something like this:
  17. ctx = fragroute_init(mtu, <rules>); // init library
  18. // process a packet
  19. fragroute_process(ctx, char *pktbuff, int pktsize)
  20. // read resulting fragments
  21. while ((ret = fragroute_read(ctx, char **fragment)) > 0) {
  22. // do something with fragment
  23. } else {
  24. // no more fragments
  25. }