socket-pfring.c 535 B

1234567891011121314151617181920212223
  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 "socket.h"
  9. #include "../lib/includes.h"
  10. #include "state.h"
  11. #include <pfring_zc.h>
  12. sock_t get_socket(uint32_t id)
  13. {
  14. sock_t sock;
  15. sock.pf.queue = zconf.pf.queues[id];
  16. sock.pf.buffers = zconf.pf.buffers + 256*id;
  17. return sock;
  18. }