Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. winpcap handle problem

winpcap handle problem

Scheduled Pinned Locked Moved C / C++ / MFC
help
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    summo
    wrote on last edited by
    #1

    :suss:In the code below packet_handler function is not the member of the class I want to display the data generating from this function to be displayed on the list box. But handle to the list box is not there as is not the member of the class. Is there any way I can get handle of listbox into the function p_h below. It is important the funtion declaration of "paket_handler" is defined in the library file so the return type or parameter cannot change. //defined in winpcap library void sniff::OnButton1() { pcap_loop(adhandle, 0, packet_handler, NULL);//call to the call back //packet_handler function } void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) { ih = (ip_header *) (pkt_data + 14); //length of ethernet header ip_len = (ih->ver_ihl & 0xf) * 4; ......//more code ...... /* print ip addresses and udp ports */ printf("%d.%d.%d.%d -> %d.%d.%d.%d\n", ih->saddr.byte1,ih->saddr.byte2,ih->saddr.byte3,ih->saddr.byte4, ih->daddr.byte1,ih->daddr.byte2,ih->daddr.byte3,ih->daddr.byte4); } Reply me soon

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups