Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
927f8bee
Commit
927f8bee
authored
Aug 15, 2014
by
André Hentschel
Committed by
Alexandre Julliard
Aug 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wpcap: Implement pcap_dispatch.
parent
eaad4fea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
wpcap.c
dlls/wpcap/wpcap.c
+37
-1
wpcap.spec
dlls/wpcap/wpcap.spec
+1
-1
No files found.
dlls/wpcap/wpcap.c
View file @
927f8bee
/*
* WPcap.dll Proxy.
*
* Copyright 2011 André Hentschel
* Copyright 2011
, 2014
André Hentschel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -19,6 +19,8 @@
*/
#include <pcap/pcap.h>
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wpcap
);
...
...
@@ -37,6 +39,40 @@ int CDECL wine_pcap_datalink(pcap_t *p)
return
pcap_datalink
(
p
);
}
typedef
struct
{
void
(
CALLBACK
*
pfn_cb
)(
u_char
*
,
const
struct
pcap_pkthdr
*
,
const
u_char
*
);
void
*
user_data
;
}
PCAP_HANDLER_CALLBACK
;
static
void
pcap_handler_callback
(
u_char
*
user_data
,
const
struct
pcap_pkthdr
*
h
,
const
u_char
*
p
)
{
PCAP_HANDLER_CALLBACK
*
pcb
;
TRACE
(
"(%p %p %p)
\n
"
,
user_data
,
h
,
p
);
pcb
=
(
PCAP_HANDLER_CALLBACK
*
)
user_data
;
pcb
->
pfn_cb
(
pcb
->
user_data
,
h
,
p
);
HeapFree
(
GetProcessHeap
(),
0
,
pcb
);
TRACE
(
"Callback COMPLETED
\n
"
);
}
int
CDECL
wine_pcap_dispatch
(
pcap_t
*
p
,
int
cnt
,
void
(
CALLBACK
*
callback
)(
u_char
*
,
const
struct
pcap_pkthdr
*
,
const
u_char
*
),
unsigned
char
*
user
)
{
TRACE
(
"(%p %i %p %p)
\n
"
,
p
,
cnt
,
callback
,
user
);
if
(
callback
)
{
PCAP_HANDLER_CALLBACK
*
pcb
;
pcb
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PCAP_HANDLER_CALLBACK
));
pcb
->
pfn_cb
=
callback
;
pcb
->
user_data
=
user
;
return
pcap_dispatch
(
p
,
cnt
,
pcap_handler_callback
,
(
unsigned
char
*
)
pcb
);
}
return
pcap_dispatch
(
p
,
cnt
,
NULL
,
user
);
}
int
CDECL
wine_pcap_findalldevs
(
pcap_if_t
**
alldevsp
,
char
*
errbuf
)
{
int
ret
;
...
...
dlls/wpcap/wpcap.spec
View file @
927f8bee
...
...
@@ -15,7 +15,7 @@
@ stub pcap_datalink_name_to_val
@ stub pcap_datalink_val_to_description
@ stub pcap_datalink_val_to_name
@
stub
pcap_dispatch
@
cdecl pcap_dispatch(ptr long ptr ptr) wine_
pcap_dispatch
@ stub pcap_dump
@ stub pcap_dump_close
@ stub pcap_dump_file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment