[prev in list] [next in list] [prev in thread] [next in thread] 

List:       winpcap-users
Subject:    Re: [Winpcap-users] pushing captured data to windows pipe
From:       "Gianluca Varenni" <gianluca.varenni () cacetech ! com>
Date:       2007-12-03 16:38:58
Message-ID: 003a01c835d4$e19a16d0$1a4da8c0 () NELSON2
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I need to double check, but I don't think it's possible to open a named pipe with \
winpcap/libpcap (as it uses the FILE* functions). But you can definitely write on \
stdout by using "-" as the name of the file.

Have a nice day
GV
  ----- Original Message ----- 
  From: Vito Arh 
  To: winpcap-users@winpcap.org 
  Sent: Friday, November 30, 2007 1:48 AM
  Subject: [Winpcap-users] pushing captured data to windows pipe


  Hello. I am trying to open pipe and send data to pipe (for later import in \
wireshark via wireshark -k -i  \\.\pipe\DLC_s ).  I do it this way:
  hPipe = CreateNamedPipe( \\.\pipe\DLC_s, PIPE_ACCESS_OUTBOUND, PIPE_NOWAIT, \
PIPE_UNLIMITED_INSTANCES, 256, 256, 1000, NULL);

  ConnectNamedPipe(hPipe, NULL);

  dumpfile = (unsigned char*) pcap_dump_open(adhandle, argv[5]);

              if(dumpfile==NULL)
              {
                  fprintf(stderr,"\nError opening output file\n");
                  return -1;
              }
              printf("Dump file opened!\n");

  The problem is that I cannot open file with pcap_dump_open. If I try opening with \
FILE *output it does without errors. This function pcap_dump_open returns NULL \
pointer.  How should I do that?
  The problem is that I try to sniff some interface which wireshark cannot recognise \
(on COM port).  Thanks for help!
  Vito.



------------------------------------------------------------------------------
  Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.


------------------------------------------------------------------------------


  _______________________________________________
  Winpcap-users mailing list
  Winpcap-users@winpcap.org
  https://www.winpcap.org/mailman/listinfo/winpcap-users


[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE type=text/css>DIV {
	MARGIN: 0px
}
</STYLE>

<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I need to double check, but I don't think it's possible to 
open a named pipe with winpcap/libpcap (as&nbsp;it uses the FILE* functions). 
But you can definitely write on stdout by using "-" as the name of the 
file.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 \
2px solid; MARGIN-RIGHT: 0px">  <DIV style="FONT: 10pt arial">----- Original Message \
----- </DIV>  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=vitoarh@yahoo.com href="mailto:vitoarh@yahoo.com">Vito Arh</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org 
  href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, November 30, 2007 1:48 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] pushing captured 
  data to windows pipe</DIV>
  <DIV><BR></DIV>
  <DIV 
  style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
  <DIV>Hello. I am trying to open pipe and send data to pipe (for later import 
  in wireshark via wireshark -k -i&nbsp; <A 
  href="file://\\.\pipe\DLC_s">\\.\pipe\DLC_s</A> ).<BR>I do it this 
  way:<BR>hPipe = CreateNamedPipe( <A 
  href="file://\\.\pipe\DLC_s">\\.\pipe\DLC_s</A>, PIPE_ACCESS_OUTBOUND, 
  PIPE_NOWAIT, PIPE_UNLIMITED_INSTANCES, 256, 256, 1000, 
  NULL);<BR><BR>ConnectNamedPipe(hPipe, NULL);<BR><BR>dumpfile = (unsigned 
  char*) pcap_dump_open(adhandle, argv[5]);<BR><BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(dumpfile==NULL)<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  fprintf(stderr,"\nError opening output file\n");<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 
  -1;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  }<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf("Dump 
  file opened!\n");<BR><BR>The problem is that I cannot open file with 
  pcap_dump_open. If I try opening with FILE *output it does without errors. 
  This function pcap_dump_open returns NULL pointer.<BR>How should I do 
  that?<BR>The problem is that I try to sniff some interface which wireshark 
  cannot recognise (on COM port).<BR>Thanks for 
  help!<BR>Vito.<BR></DIV></DIV><BR>
  <HR SIZE=1>
  Be a better sports nut! Let your teams follow you with Yahoo Mobile. <A 
  href="http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ">Try \
  it now.</A>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Winpcap-users 
  mailing 
  list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BODY></HTML>




_______________________________________________
Winpcap-users mailing list
Winpcap-users@winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic