source: examples/munge/lib/lib.h @ 5959435

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 5959435 was 5959435, checked in by Perry Lorier <perry@…>, 16 years ago

Add new munge program to the libtrace examples

  • Property mode set to 100644
File size: 912 bytes
Line 
1#ifndef LIB_H
2#define LIB_H
3#include <stdint.h>
4#include <libtrace.h>
5
6/** The encryption algorithm used
7 */
8enum enc_type_t {
9        ENC_NONE,                       /**< No encryption */
10        ENC_PREFIX_SUBSTITUTION,        /**< Substitute a prefix */
11        ENC_CRYPTOPAN                   /**< Prefix preserving encryption */
12        };
13
14/** File type to write
15 */
16enum trace_format_t {
17        TRACE_FORMAT_ERF,               /**< ERF format */
18        TRACE_FORMAT_PCAP,              /**< PCAP format */
19};
20
21/** (re)initialise the IP encryption module
22 * @param type The encryption type
23 * @param key a key (format dependant on the type of key)
24 *
25 * @note calling this function clears the cache.
26 */
27void trace_enc_init(enum enc_type_t type,char *key);
28
29/** encrypt one IP address
30 * @param orig_addr the original IP address in HOST byte order
31 * @returns the encrypted IP in HOST byte order
32 *
33 * @note: requires you to have called trace_enc_init() first
34 */
35uint32_t trace_enc_ip(uint32_t orig_addr);
36
37#endif
Note: See TracBrowser for help on using the repository browser.