1 | /* |
---|
2 | * This file is part of libtrace |
---|
3 | * |
---|
4 | * Copyright (c) 2004 The University of Waikato, Hamilton, New Zealand. |
---|
5 | * Authors: Daniel Lawson |
---|
6 | * Perry Lorier |
---|
7 | * |
---|
8 | * All rights reserved. |
---|
9 | * |
---|
10 | * This code has been developed by the University of Waikato WAND |
---|
11 | * research group. For further information please see http://www.wand.net.nz/ |
---|
12 | * |
---|
13 | * libtrace is free software; you can redistribute it and/or modify |
---|
14 | * it under the terms of the GNU General Public License as published by |
---|
15 | * the Free Software Foundation; either version 2 of the License, or |
---|
16 | * (at your option) any later version. |
---|
17 | * |
---|
18 | * libtrace is distributed in the hope that it will be useful, |
---|
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | * GNU General Public License for more details. |
---|
22 | * |
---|
23 | * You should have received a copy of the GNU General Public License |
---|
24 | * along with libtrace; if not, write to the Free Software |
---|
25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
26 | * |
---|
27 | * $Id$ |
---|
28 | * |
---|
29 | */ |
---|
30 | |
---|
31 | #include "libtrace.h" |
---|
32 | #include "format.h" |
---|
33 | #include <inttypes.h> |
---|
34 | |
---|
35 | static int template_init_input(struct libtrace_t *libtrace) { |
---|
36 | return -1; |
---|
37 | } |
---|
38 | |
---|
39 | static int template_init_output(struct libtrace_out_t *libtrace) { |
---|
40 | return -1; |
---|
41 | } |
---|
42 | |
---|
43 | static int template_fin_input(struct libtrace_t *libtrace) { |
---|
44 | return -1; |
---|
45 | } |
---|
46 | |
---|
47 | static int template_fin_output(struct libtrace_out_t *libtrace) { |
---|
48 | return -1; |
---|
49 | } |
---|
50 | |
---|
51 | static int template_read(struct libtrace_t *libtrace, void *buffer, size_t len) { |
---|
52 | return -1; |
---|
53 | } |
---|
54 | static int template_read_packet(struct libtrace_t *libtrace, struct libtrace_packet_t *packet) { |
---|
55 | return -1; |
---|
56 | } |
---|
57 | |
---|
58 | static int template_write_packet(struct libtrace_out_t *libtrace, struct libtrace_packet_t *packet) { |
---|
59 | return -1; |
---|
60 | } |
---|
61 | |
---|
62 | static void *template_get_link(const struct libtrace_packet_t *packet) { |
---|
63 | return NULL; |
---|
64 | } |
---|
65 | |
---|
66 | static libtrace_linktype_t template_get_link_type(const struct libtrace_packet_t *packet) { |
---|
67 | return -1; |
---|
68 | } |
---|
69 | |
---|
70 | static int8_t template_get_direction(const struct libtrace_packet_t *packet) { |
---|
71 | return -1; |
---|
72 | } |
---|
73 | |
---|
74 | static int8_t template_set_direction(const struct libtrace_packet_t *packet, int8_t direction) { |
---|
75 | return -1; |
---|
76 | } |
---|
77 | |
---|
78 | static uint64_t template_get_erf_timestamp(const struct libtrace_packet_t *packet) { |
---|
79 | return -1; |
---|
80 | } |
---|
81 | |
---|
82 | static struct timeval template_get_timeval(const struct libtrace_packet_t *packet) { |
---|
83 | struct timeval tv; |
---|
84 | return tv; |
---|
85 | } |
---|
86 | |
---|
87 | static double template_get_seconds(const struct libtrace_packet_t *packet) { |
---|
88 | return -1; |
---|
89 | } |
---|
90 | |
---|
91 | static int template_get_capture_length(const struct libtrace_packet_t *packet) { |
---|
92 | return -1; |
---|
93 | } |
---|
94 | |
---|
95 | static int template_get_wire_length(const struct libtrace_packet_t *packet) { |
---|
96 | return -1; |
---|
97 | } |
---|
98 | |
---|
99 | static size_t template_set_capture_length(const struct libtrace_packet_t *packet,size_t size) { |
---|
100 | return -1; |
---|
101 | } |
---|
102 | |
---|
103 | static struct format_t template = { |
---|
104 | "template", |
---|
105 | "$Id$", |
---|
106 | template_init_input, /* init_input */ |
---|
107 | template_init_output, /* init_output */ |
---|
108 | template_fin_input, /* fin_input */ |
---|
109 | template_fin_output, /* fin_output */ |
---|
110 | template_read, /* read */ |
---|
111 | template_read_packet, /* read_packet */ |
---|
112 | template_write_packet, /* write_packet */ |
---|
113 | template_get_link, /* get_link */ |
---|
114 | template_get_link_type, /* get_link_type */ |
---|
115 | template_get_direction, /* get_direction */ |
---|
116 | template_set_direction, /* set_direction */ |
---|
117 | template_get_erf_timestamp, /* get_erf_timestamp */ |
---|
118 | template_get_timeval, /* get_timeval */ |
---|
119 | template_get_seconds, /* get_seconds */ |
---|
120 | template_get_capture_length, /* get_capture_length */ |
---|
121 | template_get_wire_length, /* get_wire_length */ |
---|
122 | template_set_capture_length /* set_capture_length */ |
---|
123 | }; |
---|
124 | |
---|
125 | void __attribute__((constructor)) template_constructor() { |
---|
126 | register_format(&template); |
---|
127 | } |
---|