File: HACKING

package info (click to toggle)
tcpreplay 4.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,372 kB
  • sloc: ansic: 32,945; sh: 4,377; makefile: 1,124; perl: 138
file content (63 lines) | stat: -rw-r--r-- 2,458 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$Id$ 
                          Guide to Hacking Tcpreplay

[Note: Pay attention to the last update date at the top of this file.  If it
was significantly long ago, this document may be out of date.]

0. Contributing Code

If you contribute code the following will happen:
    a) You will be given credit in the CREDITS file
    b) Your code will be licensed under the same license as that of tcpreplay
    c) You will be assigning your copyright to Aaron Turner 
       and Fred Klassen - Appneta Inc.

If you have any questions regarding any of the three above stipulations,
feel free to email the list at: tcpreplay-users@lists.sourceforge.net


1. Introduction

If you're reading this to find out how to add a new feature or fix a bug in
tcpreplay or tcpprep, then you've come to the right place.  This isn't the
place to find answers regarding how to use tcpreplay, the meaning of life,
etc.

2. File Layout

The file layout is pretty simple:

/                    - Base directory
/lib                 - 3rd party libraries stolen verbatim
/libopts             - GNU AutoOpts tearoff
/src                 - Main code routines
/src/common          - Common routines for all binaries
/src/tcpedit         - libtcpedit
/src/tcpedit/plugins - plugins for libtcpedit (mostly DLT)
/docs                - Where to find documentation
/test                - Test scripts and stuff which is used during 'make test'

3. Coding Standards
1) Indent 4 spaces using spaces, not tabs
2) Opening braces for control blocks (if, while, etc) should be on the same line
3) Opening braces for functions should be on next line
4) Use provided warnx, dbg, and errx functions provided in err.h
5) Use provided safe_strdup, safe_malloc and safe_realloc functions provided
    in common/utils.h
6) Use provided strl* functions in lib/strlcat.c and lib/strlcpy.c

4. Adding support for additional DLTs (Data Link Types)

libtcpedit supports a plugin based architecture for handling different DLT
types.  If you wish to add support for another DLT type, you should read:

http://tcpreplay.synfin.net/wiki/tcpeditDeveloper

Which contains information on creating new DLT plugins.

5. Hacking tcprewrite

Tcprewrite is basically a front-end to libtcpedit.  Hence any packet editing
improvements should be done there.  However, please remember that tcprewrite
is not the only application which uses libtcpedit (tcpbridge is another
example) so make sure you test your code there too.