traceroute.h 909 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef TRACEROUTE_H
  2. #define TRACEROUTE_H
  3. #include "ping.h"
  4. #include "socket.h"
  5. #include "w5500.h"
  6. // Maximum number of hops for the traceroute
  7. #define MAX_HOPS 30
  8. // The UDP port for sending traceroute packets (typically 33434 for traceroute)
  9. #define PORT 33434
  10. // Buffer length for the ping message
  11. #define BUF_LEN 32
  12. // Function to perform a traceroute
  13. uint8_t traceroute(uint8_t s, uint8_t* dest_addr);
  14. // Function to send a traceroute request with a specific TTL value
  15. void send_traceroute_request(uint8_t s, uint8_t* dest_addr, uint8_t ttl);
  16. // Function to receive and process a traceroute reply
  17. void receive_traceroute_reply(uint8_t s, uint8_t* addr, uint16_t len);
  18. // Function to set the TTL value for outgoing packets
  19. void set_ttl(uint8_t s, uint8_t ttl);
  20. // Function to compute the checksum of a given data buffer
  21. uint16_t checksum(uint8_t* data_buf, uint16_t len);
  22. #endif // TRACEROUTE_H