get_gateway.c 719 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * ZMap Copyright 2013 Regents of the University of Michigan
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy
  6. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7. */
  8. #include <stdlib.h>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <unistd.h>
  12. #include <errno.h>
  13. #include <assert.h>
  14. #include <string.h>
  15. #include <pcap/pcap.h>
  16. #include "../lib/includes.h"
  17. #include "../lib/logger.h"
  18. #include "../lib/xalloc.h"
  19. #include <sys/ioctl.h>
  20. #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
  21. #include "get_gateway-bsd.h"
  22. #else // (linux)
  23. #include "get_gateway-linux.h"
  24. #endif