Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3846706
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:26:20+00:00 2026-05-19T16:26:20+00:00

I have to write a trceroute script but I’m not sure if my attempts

  • 0

I have to write a trceroute script but I’m not sure if my attempts are correct.

Right now I’m doing it like that (please correct me if I’m doing wrong or clumsy):

  1. Got an struct for ip- and udpheader
  2. A checksum function
  3. Opening 2 sockets: One for sending UDP-packets in SOCK_RAW mode (to manipulate ttl) and one to receive ICMP-answers from the routers.
  4. Using sendto() to send UDP packet
  5. Having no clue how to receive and process an ICMP answer

Are there any more comfortable ways to change the TTL than using sock_raw where I have to define all header stuff by myself?
What parameters should I use for socket() when opening ICMP sock?
How to receive the ICMP answer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T16:26:20+00:00Added an answer on May 19, 2026 at 4:26 pm

    What platform are you targeting? Here’s a BSD flavor from OpenBSD source:

    if ((s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0)
        err(5, "icmp socket");
    if ((sndsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
        err(5, "raw socket");
    

    On Linux, I believe, you need to use IP_RECVERR and recvmsg(2) with the MSG_ERRQUEUE, see ip(7).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The debug screen says that django does not have write access to the db.
I have write a script for renaming it is like this for i in
Some items don't have write access right due to workflow state write not being
I have develop a Telerik Radscheduler in that i have write the code like
Many of you guys agree that the developers should not have write access to
Suppose that for administrative reasons I do not have write access to module xxx.
I'm writing a simple web app in PHP that needs to have write access
I have to write an applet that brings up a password dialog. The problem
I have to write something in vbscript that need to use a unique set.
I have to write a component that re-creates SQL Server tables (structure and data)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.