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 7405887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:28:19+00:00 2026-05-29T05:28:19+00:00

I have made a module which is transmitting but I don’t know whether the

  • 0

I have made a module which is transmitting but I don’t know whether the packet which I am transmitting is a ping packet or not. Code is shown below:

 icmp.type = 8;
 icmp.code = 0;
 icmp.un.echo.sequence = i;
 ip4.protocol = 1; //for icmp protocol
 ip4.frag_off = 0;
 ip4.daddr = in_aton(procfs_buffer);
 ip4.saddr = in_aton(ifr->ifr_addr.sa_data);

 len = sizeof(data);

 skb = dev_alloc_skb(1500);
 skb->dev = __dev_get_by_name(&init_net,"wlan0");
 skb_reserve(skb,NET_IP_ALIGN); // header of 2 bytes; increments tail and 
                                // data pointer
 skb->data = skb_put(skb,sizeof(len)); // increments all pointer or adds data
 memcpy(data,skb->data,len);

 skb->transport_header =skb_push(skb,sizeof(icmp));
 memset(skb->transport_header,0,sizeof(struct icmphdr));
 memcpy(skb->transport_header,&icmp,sizeof(struct icmphdr));

 skb->network_header=skb_push(skb,sizeof(ip4));
 memset(skb->network_header,0,sizeof(struct iphdr));
 memcpy(skb->network_header,&ip4,sizeof(struct iphdr));

 // printk("i::%d\n",i);
 // skb->mac_header = skb_push(skb,6*sizeof(0xFF));
 // memset(skb->mac_header,0xFF,6*sizeof(0xFF));
 dev_queue_xmit(skb);
 kfree(skb);

How can I know that it is a ping packet which I am creating and transmitting? Further I want to receieve the ping packet in response to my ping packet which I have transmitted. I would like to use napi but wont mind any other suggestions.

please read a topic : reception napi mode here i could nt understand what to do from the link above…..

  • 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-29T05:28:20+00:00Added an answer on May 29, 2026 at 5:28 am

    a ping packet is simply icmp packet with code 8, with timestamp in its data
    icmp echo reply (ping reply) just copies the data from the icmp echo request and sends it back, this way ping can tell you how much time it took for the round trip (now – prev’ sended time)

    i am not very familiar with the linux kernel, but be sure to calculate the correct ip and icmp checksums

    also for receiving, it might be better to use netfilter

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

Sidebar

Related Questions

i have made a module which aims to send the ping packet using ioctl
I have made some code which exports some details of a journal article to
I have made a new windows service which works fine using barebone code (just
I have made a web app where I am using a module which redirects
Have some Perl code which is using the DBI module - (the code is
I have a custom module I made for Magento. From the admin, there is
I have a custom module I made to show featured products on the homepage.
I have made a class which a form can inherit from and it handles
I have made one project in java. Now in this particular module, i am
On my Drupal site, I have made a Users page using the Views module,

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.