socket.h 712 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #ifndef ZMAP_SOCKET_H
  9. #define ZMAP_SOCKET_H
  10. #include <stdint.h>
  11. #include "../lib/includes.h"
  12. #ifdef PFRING
  13. #include <pfring_zc.h>
  14. typedef union {
  15. int sock;
  16. struct {
  17. pfring_zc_queue *queue;
  18. pfring_zc_pkt_buff **buffers;
  19. int idx;
  20. } pf;
  21. } sock_t;
  22. #else
  23. typedef struct {
  24. int sock;
  25. } sock_t;
  26. #endif /* PFRING */
  27. sock_t get_dryrun_socket(void);
  28. sock_t get_socket(uint32_t id);
  29. #endif /* ZMAP_SOCKET_H */