File: ikev1_db_ops.h

package info (click to toggle)
libreswan 5.2-2.3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 81,644 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (43 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download | duplicates (2)
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
/*	db_ops.h,v 1.1.2.1 2003/11/21 18:12:23 jjo Exp	*/
#ifndef _DB_OPS_H
#define _DB_OPS_H

#include "ikev1_spdb.h"

/*
 *      Main db object, (quite proposal "oriented")
 */
struct db_context {
	struct db_prop prop;            /* proposal buffer (not pointer) */
	struct db_trans *trans0;        /* transf. list, dynamically sized */
	struct db_trans *trans_cur;     /* current transform ptr */
	struct db_attr *attrs0;         /* attr. list, dynamically sized */
	struct db_attr *attrs_cur;      /* current attribute ptr */
	int max_trans;                  /* size of trans list */
	int max_attrs;                  /* size of attrs list */
};

/*
 *      Allocate a new db object
 */
extern struct db_context *db_prop_new(uint8_t protoid, int max_trans,
				int max_attrs);

/*	Free all resources for this db */
extern void db_destroy(struct db_context *ctx);

/*	Start a new transform */
extern void db_trans_add(struct db_context *ctx, uint8_t transid);

/*	Add a new attribute by value */
extern void db_attr_add_values(struct db_context *ctx, enum ikev1_ipsec_attr type, uint16_t val);

/*	Get proposal from db object */
struct db_prop *db_prop_get(struct db_context *ctx);

/*	Show stats (allocation, etc) */
void show_db_ops_status(struct show *s);

extern void db_print(struct db_context *ctx);

#endif /* _DB_OPS_H */