File: grok_capture_xdr.c

package info (click to toggle)
grok 1.20110708.1-4.3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,460 kB
  • sloc: ansic: 3,469; ruby: 987; makefile: 276; sh: 124; yacc: 106
file content (115 lines) | stat: -rw-r--r-- 3,439 bytes parent folder | download | duplicates (5)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#include "grok_capture.h"

bool_t
xdr_grok_capture (XDR *xdrs, grok_capture *objp)
{
	register int32_t *buf;


	if (xdrs->x_op == XDR_ENCODE) {
		 if (!xdr_int (xdrs, &objp->name_len))
			 return FALSE;
		 if (!xdr_string (xdrs, &objp->name, ~0))
			 return FALSE;
		 if (!xdr_int (xdrs, &objp->subname_len))
			 return FALSE;
		 if (!xdr_string (xdrs, &objp->subname, ~0))
			 return FALSE;
		 if (!xdr_int (xdrs, &objp->pattern_len))
			 return FALSE;
		 if (!xdr_string (xdrs, &objp->pattern, ~0))
			 return FALSE;
		buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			 if (!xdr_int (xdrs, &objp->id))
				 return FALSE;
			 if (!xdr_int (xdrs, &objp->pcre_capture_number))
				 return FALSE;
			 if (!xdr_int (xdrs, &objp->predicate_lib_len))
				 return FALSE;

		} else {
		IXDR_PUT_LONG(buf, objp->id);
		IXDR_PUT_LONG(buf, objp->pcre_capture_number);
		IXDR_PUT_LONG(buf, objp->predicate_lib_len);
		}
		 if (!xdr_string (xdrs, &objp->predicate_lib, ~0))
			 return FALSE;
		 if (!xdr_int (xdrs, &objp->predicate_func_name_len))
			 return FALSE;
		 if (!xdr_string (xdrs, &objp->predicate_func_name, ~0))
			 return FALSE;
		 if (!xdr_bytes (xdrs, (char **)&objp->extra.extra_val, (u_int *) &objp->extra.extra_len, ~0))
			 return FALSE;
		return TRUE;
	} else if (xdrs->x_op == XDR_DECODE) {
		 if (!xdr_int (xdrs, &objp->name_len))
			 return FALSE;
		 if (!xdr_string (xdrs, &objp->name, ~0))
			 return FALSE;
		 if (!xdr_int (xdrs, &objp->subname_len))
			 return FALSE;
		 if (!xdr_string (xdrs, &objp->subname, ~0))
			 return FALSE;
		 if (!xdr_int (xdrs, &objp->pattern_len))
			 return FALSE;
		 if (!xdr_string (xdrs, &objp->pattern, ~0))
			 return FALSE;
		buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			 if (!xdr_int (xdrs, &objp->id))
				 return FALSE;
			 if (!xdr_int (xdrs, &objp->pcre_capture_number))
				 return FALSE;
			 if (!xdr_int (xdrs, &objp->predicate_lib_len))
				 return FALSE;

		} else {
		objp->id = IXDR_GET_LONG(buf);
		objp->pcre_capture_number = IXDR_GET_LONG(buf);
		objp->predicate_lib_len = IXDR_GET_LONG(buf);
		}
		 if (!xdr_string (xdrs, &objp->predicate_lib, ~0))
			 return FALSE;
		 if (!xdr_int (xdrs, &objp->predicate_func_name_len))
			 return FALSE;
		 if (!xdr_string (xdrs, &objp->predicate_func_name, ~0))
			 return FALSE;
		 if (!xdr_bytes (xdrs, (char **)&objp->extra.extra_val, (u_int *) &objp->extra.extra_len, ~0))
			 return FALSE;
	 return TRUE;
	}

	 if (!xdr_int (xdrs, &objp->name_len))
		 return FALSE;
	 if (!xdr_string (xdrs, &objp->name, ~0))
		 return FALSE;
	 if (!xdr_int (xdrs, &objp->subname_len))
		 return FALSE;
	 if (!xdr_string (xdrs, &objp->subname, ~0))
		 return FALSE;
	 if (!xdr_int (xdrs, &objp->pattern_len))
		 return FALSE;
	 if (!xdr_string (xdrs, &objp->pattern, ~0))
		 return FALSE;
	 if (!xdr_int (xdrs, &objp->id))
		 return FALSE;
	 if (!xdr_int (xdrs, &objp->pcre_capture_number))
		 return FALSE;
	 if (!xdr_int (xdrs, &objp->predicate_lib_len))
		 return FALSE;
	 if (!xdr_string (xdrs, &objp->predicate_lib, ~0))
		 return FALSE;
	 if (!xdr_int (xdrs, &objp->predicate_func_name_len))
		 return FALSE;
	 if (!xdr_string (xdrs, &objp->predicate_func_name, ~0))
		 return FALSE;
	 if (!xdr_bytes (xdrs, (char **)&objp->extra.extra_val, (u_int *) &objp->extra.extra_len, ~0))
		 return FALSE;
	return TRUE;
}