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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. pcap_dump() problem

pcap_dump() problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpsharepointlinuxtutorialquestion
3 Posts 2 Posters 1 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
    styve
    wrote on last edited by
    #1

    Hello! Im using libpcap for linux. I have a problem with the command pcap_dump(u_char *user, struct pcap_pkthdr *h, u_char *sp). The first argument will be the result from pcap_dump_open() (the file I will write to), but the problem is that it's not a u_char result from pcap_dump_open, it is a pcap_dumper_t. Is there a command for conversion from pcap_dumper_t to u_char? In the tutorial the first argument can be a pcap_dumper_t value, but it will not work. Thankful for your help, Stefan

    G S 2 Replies Last reply
    0
    • S styve

      Hello! Im using libpcap for linux. I have a problem with the command pcap_dump(u_char *user, struct pcap_pkthdr *h, u_char *sp). The first argument will be the result from pcap_dump_open() (the file I will write to), but the problem is that it's not a u_char result from pcap_dump_open, it is a pcap_dumper_t. Is there a command for conversion from pcap_dumper_t to u_char? In the tutorial the first argument can be a pcap_dumper_t value, but it will not work. Thankful for your help, Stefan

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      <snip> node_t *n; pcap_t *cap; n->dumper = pcap_dump_open(cap, n->filename); pcap_dump((u_char *)n->dumper, &n->fifo_phd[i], n->fifo_pkt[i]); </snip> found this in http://www.cartel-securite.fr/pbiondi/c/pcapdispatcher.c[^] hth, 'G'

      1 Reply Last reply
      0
      • S styve

        Hello! Im using libpcap for linux. I have a problem with the command pcap_dump(u_char *user, struct pcap_pkthdr *h, u_char *sp). The first argument will be the result from pcap_dump_open() (the file I will write to), but the problem is that it's not a u_char result from pcap_dump_open, it is a pcap_dumper_t. Is there a command for conversion from pcap_dumper_t to u_char? In the tutorial the first argument can be a pcap_dumper_t value, but it will not work. Thankful for your help, Stefan

        S Offline
        S Offline
        styve
        wrote on last edited by
        #3

        It was to simple to understand in the beginning, you always will do the hard way =) just put pcap_dump((u_char*)outFile, header, packet)

        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