aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-fmp_notify.c
blob: f8d6bb1f59dee9b66709c7f2e0640eb8f33eca85 (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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
/* packet-fmp_notify.c
 * Routines for fmp dissection
 *
 * $Id$
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif


#include <glib.h>

#include <epan/strutil.h>

#include "packet-rpc.h"
#include "packet-fmp.h"

#define FMP_NOTIFY_PROG 	1001912
#define FMP_NOTIFY_VERSION_2 	2

/*
 * FMP/NOTIFY Procedures
 */
#define FMP_NOTIFY_DownGrade		1
#define FMP_NOTIFY_RevokeList		2
#define FMP_NOTIFY_RevokeAll 		3
#define FMP_NOTIFY_FileSetEof 		4
#define FMP_NOTIFY_RequestDone 		5
#define FMP_NOTIFY_volFreeze 		6
#define FMP_NOTIFY_revokeHandleList	7

typedef enum {
	FMP_LIST_USER_QUOTA_EXCEEDED = 0,
	FMP_LIST_GROUP_QUOTA_EXCEEDED = 1,
	FMP_LIST_SERVER_RESOURCE_LOW = 2
} revokeHandleListReason;

static int proto_fmp_notify = -1;
static int hf_fmp_handleListLen = -1;
static int hf_fmp_notify_procedure = -1;
static int hf_fmp_fsID = -1;
static int hf_fmp_fsBlkSz = -1;
static int hf_fmp_sessionHandle = -1;
static int hf_fmp_fmpFHandle = -1;
static int hf_fmp_msgNum = -1;
static int hf_fmp_fileSize = -1;
static int hf_fmp_cookie = -1;
static int hf_fmp_firstLogBlk = -1;
static int hf_fmp_numBlksReq = -1;
static int hf_fmp_status = -1;
static int hf_fmp_extentList_len = -1;
static int hf_fmp_numBlks = -1;
static int hf_fmp_volID = -1;
static int hf_fmp_startOffset = -1;
static int hf_fmp_extent_state = -1;

static gint ett_fmp_notify = -1;
static gint ett_fmp_notify_hlist = -1;
static gint ett_fmp_extList = -1;
static gint ett_fmp_ext = -1;


static int dissect_fmp_notify_extentList(tvbuff_t *, int, packet_info *, proto_tree *);

static int
dissect_fmp_notify_status(tvbuff_t *tvb, int offset, proto_tree *tree, int *rval)
{
        fmpStat status;

        status = tvb_get_ntohl(tvb, offset);

        switch (status) {
        case FMP_OK:
                *rval = 0;
                break;
        case FMP_IOERROR:
                *rval = 1;
                break;
        case FMP_NOMEM:
                *rval = 1;
                break;
        case FMP_NOACCESS:
                *rval = 1;
                break;
	 case FMP_INVALIDARG:
                *rval = 1;
                break;
        case FMP_FSFULL:
                *rval = 0;
                break;
        case FMP_QUEUE_FULL:
                *rval = 1;
                break;
        case FMP_WRONG_MSG_NUM:
                *rval = 1;
                break;
        case FMP_SESSION_LOST:
                *rval = 1;
                break;
        case FMP_HOT_SESSION:
                *rval = 0;
                break;

	case FMP_COLD_SESSION:
                *rval = 0;
                break;
        case FMP_CLIENT_TERMINATED:
                *rval = 0;
                break;
        case FMP_WRITER_LOST_BLK:
                *rval = 1;
                break;
        case FMP_REQUEST_QUEUED:
                *rval = 0;
                break;
        case FMP_FALL_BACK:
                *rval = 0;
                break;
        case FMP_REQUEST_CANCELLED:
                *rval = 1;
                break;

	       case FMP_WRITER_ZEROED_BLK:
                *rval = 0;
                break;
        case FMP_NOTIFY_ERROR:
                *rval = 1;
                break;
        case FMP_WRONG_HANDLE:
                *rval = 0;
                break;
        case FMP_DUPLICATE_OPEN:
                *rval = 1;
                break;
        case FMP_PLUGIN_NOFUNC:
                *rval = 1;
                break;
        default:
                *rval = 1;
                break;
        }

        offset = dissect_rpc_uint32(tvb, tree, hf_fmp_status , offset);
        return offset;

}

static int
dissect_revokeHandleListReason(tvbuff_t *tvb, int offset, proto_tree *tree)
{
	revokeHandleListReason reason;

  	if (tree) {
		reason  = tvb_get_ntohl(tvb, offset);
		switch (reason) {
		case FMP_LIST_USER_QUOTA_EXCEEDED:
			proto_tree_add_text(tree, tvb, offset, 4, "Reason: %s",
					    "LIST_USER_QUOTA_EXCEEDED");
			break;

		case FMP_LIST_GROUP_QUOTA_EXCEEDED:
			proto_tree_add_text(tree, tvb, offset, 4, "Reason: %s",
					    "LIST_GROUP_QUOTA_EXCEEDED");
			break;

		case FMP_LIST_SERVER_RESOURCE_LOW:
			proto_tree_add_text(tree, tvb, offset, 4, "Reason: %s",
					    "LIST_SERVER_RESOURCE_LOW");
			break;

		default:
			proto_tree_add_text(tree, tvb, offset, 4, "Reason: %s",
					    "Unknown Reason");
			break;
		}
	}
	offset += 4;
	return offset;
}

static int
dissect_handleList(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
                   proto_tree *tree)
{

	int numHandles;
	int listLength;
	int i;
	proto_item *handleListItem;
	proto_tree *handleListTree;

	numHandles = tvb_get_ntohl(tvb, offset);
	listLength = 4;

	for (i = 0; i < numHandles; i++) {
		listLength += (4 + tvb_get_ntohl(tvb, offset + listLength));
	}

	handleListItem =  proto_tree_add_text(tree, tvb, offset, listLength,
	                                      "Handle List");
	handleListTree = proto_item_add_subtree(handleListItem,
	                                        ett_fmp_notify_hlist);

	offset = dissect_rpc_uint32(tvb,  handleListTree,
	                            hf_fmp_handleListLen, offset);

	for (i = 0; i <= numHandles; i++) {
		offset = dissect_rpc_data(tvb, handleListTree,
		                          hf_fmp_fmpFHandle, offset);/*  changed */
	}

	return offset;
}

static int
dissect_FMP_NOTIFY_DownGrade_request(tvbuff_t *tvb, int offset,
                                     packet_info *pinfo _U_, proto_tree *tree)
{


	offset = dissect_rpc_data(tvb,  tree, hf_fmp_sessionHandle,
	                          offset);
	offset = dissect_rpc_data(tvb,  tree, hf_fmp_fmpFHandle, offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
	                            offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq, offset);
	return offset;
}

static int
dissect_FMP_NOTIFY_DownGrade_reply(tvbuff_t *tvb, int offset,
                                   packet_info *pinfo _U_, proto_tree *tree)
{
	int rval;

	offset = dissect_fmp_notify_status(tvb, offset,tree, &rval);
	return offset;
}

static int
dissect_FMP_NOTIFY_RevokeList_request(tvbuff_t *tvb, int offset,
                                      packet_info *pinfo _U_, proto_tree *tree)
{

	offset = dissect_rpc_data(tvb,  tree, hf_fmp_sessionHandle,
                                  offset);
	offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_firstLogBlk,
                                    offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_numBlksReq, offset);
	return offset;
}

static int
dissect_FMP_NOTIFY_RevokeList_reply(tvbuff_t *tvb, int offset,
                                    packet_info *pinfo _U_, proto_tree *tree)
{
	int rval;

	offset = dissect_fmp_notify_status(tvb, offset,tree, &rval);
	return offset;
}

static int
dissect_FMP_NOTIFY_RevokeAll_request(tvbuff_t *tvb, int offset,
                                     packet_info *pinfo _U_, proto_tree *tree)
{
	offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
	                          offset);
	offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
	return offset;
}

static int
dissect_FMP_NOTIFY_RevokeAll_reply(tvbuff_t *tvb, int offset,
                                   packet_info *pinfo _U_, proto_tree *tree)
{
	int rval;

	offset = dissect_fmp_notify_status(tvb, offset,tree, &rval);
	return offset;
}

static int
dissect_FMP_NOTIFY_FileSetEof_request(tvbuff_t *tvb, int offset,
                                      packet_info *pinfo _U_, proto_tree *tree)
{
	offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
	                          offset);
	offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle, offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum, offset);
	offset = dissect_rpc_uint64(tvb, tree, hf_fmp_fileSize, offset);
	return offset;
}

static int
dissect_FMP_NOTIFY_FileSetEof_reply(tvbuff_t *tvb, int offset,
                                    packet_info *pinfo _U_, proto_tree *tree)
{
	int rval;

	offset = dissect_fmp_notify_status(tvb, offset,tree, &rval);
	return offset;
}

static int
dissect_FMP_NOTIFY_RequestDone_request(tvbuff_t *tvb, int offset,
                                       packet_info *pinfo, proto_tree *tree)
{
	int rval;

	offset = dissect_fmp_notify_status(tvb, offset,tree, &rval);
	if (rval == 0) {
		offset = dissect_rpc_data(tvb,  tree,
		                          hf_fmp_sessionHandle, offset);
		offset = dissect_rpc_data(tvb, tree, hf_fmp_fmpFHandle,
		                          offset);
		offset = dissect_rpc_uint32(tvb, tree, hf_fmp_msgNum,
		                            offset);
		offset = dissect_rpc_uint32(tvb, tree, hf_fmp_cookie,
		                            offset);
		offset = dissect_fmp_notify_extentList(tvb, offset, pinfo, tree);
	}
	return offset;
}

static int
dissect_FMP_NOTIFY_RequestDone_reply(tvbuff_t *tvb, int offset,
                                     packet_info *pinfo _U_, proto_tree *tree)
{
	int rval;

	offset = dissect_fmp_notify_status(tvb, offset,tree, &rval);
	return offset;
}

static int
dissect_FMP_NOTIFY_volFreeze_request(tvbuff_t *tvb, int offset,
                                     packet_info *pinfo _U_, proto_tree *tree)
{
	offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
	                          offset);
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_fsID, offset);
	return offset;
}

static int
dissect_FMP_NOTIFY_volFreeze_reply(tvbuff_t *tvb, int offset,
                                   packet_info *pinfo _U_, proto_tree *tree)
{
	int rval;

	offset = dissect_fmp_notify_status(tvb, offset,tree, &rval);
	return offset;
}

static int
dissect_FMP_NOTIFY_revokeHandleList_request(tvbuff_t *tvb, int offset,
                                            packet_info *pinfo,
                                            proto_tree *tree)
{
	offset = dissect_rpc_data(tvb, tree, hf_fmp_sessionHandle,
							                          offset);
	offset = dissect_revokeHandleListReason(tvb, offset, tree);
	offset = dissect_handleList(tvb, offset, pinfo, tree);
	return offset;
}

static int
dissect_FMP_NOTIFY_revokeHandleList_reply(tvbuff_t *tvb, int offset,
                                          packet_info *pinfo _U_, proto_tree *tree)
{
	int rval;

	offset = dissect_fmp_notify_status(tvb, offset,tree, &rval);
	return offset;
}

/*
 * proc number, "proc name", dissect_request, dissect_reply
 * NULL as function pointer means: type of arguments is "void".
 */
static const vsff fmp_notify2_proc[] = {

	{ FMP_NOTIFY_DownGrade,				"DownGrade",
	  dissect_FMP_NOTIFY_DownGrade_request,
	  dissect_FMP_NOTIFY_DownGrade_reply },

	{ FMP_NOTIFY_RevokeList,			"RevokeList",
	  dissect_FMP_NOTIFY_RevokeList_request,
	  dissect_FMP_NOTIFY_RevokeList_reply },

	{ FMP_NOTIFY_RevokeAll,				"RevokeAll",
	  dissect_FMP_NOTIFY_RevokeAll_request,
	  dissect_FMP_NOTIFY_RevokeAll_reply },

	{ FMP_NOTIFY_FileSetEof,			"FileSetEof",
	  dissect_FMP_NOTIFY_FileSetEof_request,
	  dissect_FMP_NOTIFY_FileSetEof_reply },

	{ FMP_NOTIFY_RequestDone,			"RequestDone",
	  dissect_FMP_NOTIFY_RequestDone_request,
	  dissect_FMP_NOTIFY_RequestDone_reply },

	{ FMP_NOTIFY_volFreeze,				"volFreeze",
	  dissect_FMP_NOTIFY_volFreeze_request,
	  dissect_FMP_NOTIFY_volFreeze_reply },

	{ FMP_NOTIFY_revokeHandleList,			"revokeHandleList",
	  dissect_FMP_NOTIFY_revokeHandleList_request,
	  dissect_FMP_NOTIFY_revokeHandleList_reply },

	{ 0,		NULL,		NULL,		NULL }
};

static const value_string fmp_notify_proc_vals[] = {
        { 1,    "DownGrade" },
        { 2,    "RevokeList" },
        { 3,    "RevokeAll" },
        { 4,    "FileSetEof" },
        { 5,    "RequestDone" },
        { 6,    "VolFreeze" },
        { 7,    "RevokeHandleList" },
        { 0,    "NULL" },
        { 0,NULL}
};


static const value_string fmp_status_vals[] = {
        {0,"OK"},
        {5,"IOERROR"},
        {12,"NOMEM"},
        {13,"NOACCESS"},
        {22,"INVALIDARG"},
        {28,"FSFULL"},
        {79,"QUEUE_FULL"},
        {500,"WRONG_MSG_NUM"},
        {501,"SESSION_LOST"},
        {502,"HOT_SESSION"},
        {503,"COLD_SESSION"},
        {504,"CLIENT_TERMINATED"},
        {505,"WRITER_LOST_BLK"},
        {506,"FMP_REQUEST_QUEUED"},
        {507,"FMP_FALL_BACK"},
        {508,"REQUEST_CANCELLED"},
        {509,"WRITER_ZEROED_BLK"},
        {510,"NOTIFY_ERROR"},
        {511,"FMP_WRONG_HANDLE"},
        {512,"DUPLICATE_OPEN"},
        {600,"PLUGIN_NOFUNC"},
	{0,NULL}

};


void
proto_register_fmp_notify(void)
{
	static hf_register_info hf[] = {
		{ &hf_fmp_notify_procedure, {
                        "Procedure", "fmp_notify.notify_procedure", FT_UINT32, BASE_DEC,
                        VALS(fmp_notify_proc_vals) , 0, NULL, HFILL }},        /* New addition */

		{ &hf_fmp_status, {
                        "Status", "fmp_notify.status", FT_UINT32, BASE_DEC,
                        VALS(fmp_status_vals), 0, "Reply Status", HFILL }},


		{ &hf_fmp_handleListLen, {
			"Number File Handles", "fmp_notify.handleListLength",
			FT_UINT32, BASE_DEC, NULL, 0,
			"Number of File Handles", HFILL }},


		{ &hf_fmp_sessionHandle, {
                        "Session Handle", "fmp_notify.sessHandle", FT_BYTES, BASE_NONE,
                        NULL, 0, "FMP Session Handle", HFILL }},


                { &hf_fmp_fsID, {
                        "File System ID", "fmp_notify.fsID", FT_UINT32, BASE_HEX,
                        NULL, 0, NULL, HFILL }},

                { &hf_fmp_fsBlkSz, {
                        "FS Block Size", "fmp_notify.fsBlkSz", FT_UINT32, BASE_DEC,
                        NULL, 0, "File System Block Size", HFILL }},


                { &hf_fmp_numBlksReq, {
                        "Number Blocks Requested", "fmp_notify.numBlksReq", FT_UINT32,
                        BASE_DEC, NULL, 0, NULL, HFILL }},


                { &hf_fmp_msgNum, {
                        "Message Number", "fmp_notify.msgNum", FT_UINT32, BASE_DEC,
                        NULL, 0, "FMP Message Number", HFILL }},

                { &hf_fmp_cookie, {
                        "Cookie", "fmp_notify.cookie", FT_UINT32, BASE_HEX,
                        NULL, 0, "Cookie for FMP_REQUEST_QUEUED Resp", HFILL }},


                { &hf_fmp_firstLogBlk, {
                        "First Logical Block", "fmp_notify.firstLogBlk", FT_UINT32,
                        BASE_DEC, NULL, 0, "First Logical File Block", HFILL }},


                { &hf_fmp_fileSize, {
                        "File Size", "fmp_notify.fileSize", FT_UINT64, BASE_DEC,
                        NULL, 0, NULL, HFILL }},

		 { &hf_fmp_fmpFHandle, {
                        "FMP File Handle", "fmp_notify.fmpFHandle",
                        FT_BYTES, BASE_NONE, NULL, 0, NULL,
                        HFILL }},



	};

	static gint *ett[] = {
		&ett_fmp_notify,
		&ett_fmp_notify_hlist,
		&ett_fmp_extList,
		&ett_fmp_ext
	};

	proto_fmp_notify =
		proto_register_protocol("File Mapping Protocol Nofity",
		                        "FMP/NOTIFY", "fmp_notify");
	proto_register_field_array(proto_fmp_notify, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));

}

void
proto_reg_handoff_fmp_notify(void)
{
	/* Register the protocol as RPC */
	rpc_init_prog(proto_fmp_notify, FMP_NOTIFY_PROG, ett_fmp_notify);

	/* Register the procedure tables */
	rpc_init_proc_table(FMP_NOTIFY_PROG, FMP_NOTIFY_VERSION_2,
	                    fmp_notify2_proc,hf_fmp_notify_procedure);
}


static int
dissect_fmp_notify_extentState(tvbuff_t *tvb, int offset, proto_tree *tree)
{
	offset = dissect_rpc_uint32(tvb, tree, hf_fmp_extent_state,
	                            offset);

	return offset;
}

static int
dissect_fmp_notify_extent(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
                   proto_tree *tree, guint32 ext_num)
{
	proto_item *extItem;
	proto_tree *extTree;

	extItem = proto_tree_add_text(tree, tvb, offset, 20 ,
	                              "Extent (%u)", (guint32) ext_num);


	extTree = proto_item_add_subtree(extItem, ett_fmp_ext);

	offset = dissect_rpc_uint32(tvb,  extTree, hf_fmp_firstLogBlk,
	                            offset);
	offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_numBlks,
	                            offset);
	offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_volID, offset);
	offset = dissect_rpc_uint32(tvb, extTree, hf_fmp_startOffset,
	                            offset);
	offset = dissect_fmp_notify_extentState(tvb, offset, extTree);

	return offset;
}


static int
dissect_fmp_notify_extentList(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
                       proto_tree *tree)
{
	guint32 numExtents;
	guint32 totalLength;
	proto_item *extListItem;
	proto_tree *extListTree;
	guint32 i;

	numExtents = tvb_get_ntohl(tvb, offset);
	totalLength = 4 + (20 * numExtents);

	extListItem =  proto_tree_add_text(tree, tvb, offset, totalLength,
	                                   "Extent List");
	extListTree = proto_item_add_subtree(extListItem, ett_fmp_extList);

	offset = dissect_rpc_uint32(tvb, extListTree,
	                            hf_fmp_extentList_len, offset);

	for (i = 1; i <= numExtents; i++) {
		offset = dissect_fmp_notify_extent(tvb, offset, pinfo, extListTree, i);
	}

	return offset;
}