updating lsa and smb parsing routines and structures.
[kai/samba.git] / source3 / lsaparse.c
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    Samba utility functions
5    Copyright (C) Luke Leighton 1996 - 1997
6    
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 #include "includes.h"
23
24 extern int DEBUGLEVEL;
25
26
27 /*******************************************************************
28 reads or writes an LSA_Q_QUERY_INFO structure.
29 ********************************************************************/
30 char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align)
31 {
32         if (q_q == NULL) return NULL;
33
34         RW_SVAL(io, q, q_q->info_class, 0); q += 2;
35
36         return q;
37 }
38
39 /*******************************************************************
40 reads or writes an LSA_Q_QUERY_INFO structure.
41 ********************************************************************/
42 char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align)
43 {
44         if (r_q == NULL) return NULL;
45
46         RW_IVAL(io, q, r_q->undoc_buffer, 0); q += 4;
47
48         if (r_q->undoc_buffer != 0)
49         {
50                 RW_SVAL(io, q, r_q->info_class, 0); q += 2;
51
52                 switch (r_q->info_class)
53                 {
54                         case 3:
55                         {
56                                 q = smb_io_dom_query_3(io, &(r_q->dom.id3), q, base, align);
57                                 break;
58                         }
59                         case 5:
60                         {
61                                 q = smb_io_dom_query_5(io, &(r_q->dom.id3), q, base, align);
62                                 break;
63                         }
64                         default:
65                         {
66                                 /* PANIC! */
67                                 break;
68                         }
69                 }
70         }
71         return q;
72 }
73
74 #if 0
75 /*******************************************************************
76 reads or writes a structure.
77 ********************************************************************/
78  char* lsa_io_(BOOL io, *, char *q, char *base, int align)
79 {
80         if (== NULL) return NULL;
81
82         q = align_offset(q, base, align);
83         
84         RW_IVAL(io, q, , 0); q += 4;
85
86         return q;
87 }
88 /*******************************************************************
89 reads or writes a structure.
90 ********************************************************************/
91  char* lsa_io_(BOOL io, *, char *q, char *base, int align)
92 {
93         if (== NULL) return NULL;
94
95         q = align_offset(q, base, align);
96         
97         RW_IVAL(io, q, , 0); q += 4;
98
99         return q;
100 }
101 #endif