module_ntp.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 "../state.h"
  9. #include "../fieldset.h"
  10. #ifndef MODULE_NTP_H
  11. #define MODULE_NTP_H
  12. #include <stdlib.h>
  13. #include <stdio.h>
  14. #include <stdint.h>
  15. #include <unistd.h>
  16. #include <string.h>
  17. struct __attribute__((__packed__)) ntphdr{//typedef
  18. uint8_t LI_VN_MODE;
  19. uint8_t stratum;
  20. uint8_t poll;
  21. uint8_t precision;
  22. uint32_t root_delay;
  23. uint32_t root_dispersion;
  24. uint32_t ref_ID;
  25. uint64_t reference_timestamp;
  26. uint64_t origin_timestamp;
  27. uint64_t receive_timestamp;
  28. uint64_t transmit_timestamp;
  29. //uint32_t key_ID;
  30. //uint64_t dgst_1;
  31. //uint64_t dgst_2;
  32. };
  33. void ntp_process_packet(const u_char *packet, __attribute__((unused)) uint32_t len, fieldset_t *fs);
  34. int ntp_init_perthread(void *buf, macaddr_t *src, macaddr_t *gw, __attribute__((unused)) port_h_t dst_port, void **arg);
  35. void ntp_print_packet (FILE *fp, void *packet);
  36. #endif