summaryrefslogtreecommitdiff
path: root/source4/build/pidl/packet-dcerpc-eparser.c
blob: bafdf34006221ad6e43ccccde3f088ad87d0b2b6 (plain)
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
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "packet-dcerpc.h"
#include "packet-dcerpc-nt.h"
#include "packet-dcerpc-eparser.h"

/* Create a ndr_pull structure from data stored in a tvb at a given offset. */

struct e_ndr_pull *ndr_pull_init(tvbuff_t *tvb, int offset, packet_info *pinfo,
				 proto_tree *tree, guint8 *drep)
{
	struct e_ndr_pull *ndr;

	ndr = (struct e_ndr_pull *)g_malloc(sizeof(*ndr));
	
	ndr->tvb = tvb;
	ndr->offset = offset;
	ndr->pinfo = pinfo;
	ndr->tree = tree;
	ndr->drep = drep;

	return ndr;
}

/* Dispose of a dynamically allocated ndr_pull structure */

void ndr_pull_free(struct e_ndr_pull *ndr)
{
	g_free(ndr);
}

void ndr_pull_ptr(struct e_ndr_pull *e_ndr, int hf, guint32 *ptr)
{
	e_ndr->offset = dissect_ndr_uint32(
		e_ndr->tvb, e_ndr->offset, e_ndr->pinfo,
		e_ndr->tree, e_ndr->drep, hf, ptr);
}

void ndr_pull_NTSTATUS(struct e_ndr_pull *e_ndr, int hf)
{
	e_ndr->offset = dissect_ntstatus(
		e_ndr->tvb, e_ndr->offset, e_ndr->pinfo,
		e_ndr->tree, e_ndr->drep, hf, NULL);
}

void ndr_pull_uint16(struct e_ndr_pull *e_ndr, int hf)
{
	e_ndr->offset = dissect_ndr_uint16(
		e_ndr->tvb, e_ndr->offset, e_ndr->pinfo,
		e_ndr->tree, e_ndr->drep, hf, NULL);
}

void ndr_pull_uint32(struct e_ndr_pull *e_ndr, int hf)
{
	e_ndr->offset = dissect_ndr_uint32(
		e_ndr->tvb, e_ndr->offset, e_ndr->pinfo,
		e_ndr->tree, e_ndr->drep, hf, NULL);
}

void ndr_pull_policy_handle(struct e_ndr_pull *e_ndr, int hf)
{
	e_ndr->offset = dissect_nt_policy_hnd(
		e_ndr->tvb, e_ndr->offset, e_ndr->pinfo, e_ndr->tree, 
		e_ndr->drep, hf, NULL, NULL, 0, 0);
}