libssh: /build/libssh/src/libssh-0.12.0/include/libssh/pcap.h Source File

libssh 0.12.0 The SSH library

Loading...
Searching...
No Matches
pcap.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2009 by Aris Adamantiadis
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef PCAP_H_
22#define PCAP_H_
23
24#include "config.h"
25#include "libssh/libssh.h"
26
27#ifdef WITH_PCAP
28typedef struct ssh_pcap_context_struct* ssh_pcap_context;
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34int ssh_pcap_file_write_packet(ssh_pcap_file pcap, ssh_buffer packet, uint32_t original_len);
35
36ssh_pcap_context ssh_pcap_context_new(ssh_session session);
37void ssh_pcap_context_free(ssh_pcap_context ctx);
38
39enum ssh_pcap_direction{
40 SSH_PCAP_DIR_IN,
41 SSH_PCAP_DIR_OUT
42};
43void ssh_pcap_context_set_file(ssh_pcap_context, ssh_pcap_file);
44int ssh_pcap_context_write(ssh_pcap_context,enum ssh_pcap_direction direction, void *data,
45 uint32_t len, uint32_t origlen);
46
47
48#ifdef __cplusplus
49}
50#endif
51
52#endif /* WITH_PCAP */
53#endif /* PCAP_H_ */