s3-rpc_parse: remove unused BUFFER5 and UNISTR3.
authorGünther Deschner <gd@samba.org>
Wed, 18 Mar 2009 11:22:22 +0000 (12:22 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 18 Mar 2009 19:17:01 +0000 (20:17 +0100)
Guenther

source3/include/proto.h
source3/include/rpc_misc.h
source3/lib/util_unistr.c
source3/rpc_parse/parse_misc.c
source3/rpc_parse/parse_prs.c

index d0b8f22839af090b2a3f2f83ff831de9062cc16e..f96e22424985021df572c161d454ffa6aa64d235 100644 (file)
@@ -1557,7 +1557,6 @@ char *rpcstr_pull_unistr2_talloc(TALLOC_CTX *ctx, const UNISTR2 *src);
 int rpcstr_push(void *dest, const char *src, size_t dest_len, int flags);
 int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src);
 void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen);
-void unistr3_to_ascii(char *dest, const UNISTR3 *str, size_t maxlen);
 char *unistr2_to_ascii_talloc(TALLOC_CTX *ctx, const UNISTR2 *str);
 const char *unistr2_static(const UNISTR2 *str);
 smb_ucs2_t toupper_w(smb_ucs2_t val);
@@ -5685,7 +5684,6 @@ bool smb_io_uuid(const char *desc, struct GUID *uuid,
                 prs_struct *ps, int depth);
 void init_unistr(UNISTR *str, const char *buf);
 bool smb_io_unistr(const char *desc, UNISTR *uni, prs_struct *ps, int depth);
-bool smb_io_buffer5(const char *desc, BUFFER5 *buf5, prs_struct *ps, int depth);
 void init_buf_unistr2(UNISTR2 *str, uint32 *ptr, const char *buf);
 void copy_unistr2(UNISTR2 *str, const UNISTR2 *from);
 void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags);
@@ -5696,8 +5694,6 @@ bool prs_io_unistr2_p(const char *desc, prs_struct *ps, int depth, UNISTR2 **uni
 bool prs_io_unistr2(const char *desc, prs_struct *ps, int depth, UNISTR2 *uni2 );
 bool smb_io_unistr2(const char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth);
 bool smb_io_pol_hnd(const char *desc, POLICY_HND *pol, prs_struct *ps, int depth);
-void init_unistr3(UNISTR3 *str, const char *buf);
-bool smb_io_unistr3(const char *desc, UNISTR3 *name, prs_struct *ps, int depth);
 uint32 str_len_uni(UNISTR *source);
 bool policy_handle_is_valid(const POLICY_HND *hnd);
 
@@ -5755,9 +5751,7 @@ bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint
 bool prs_uint16s(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
 bool prs_uint16uni(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
 bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uint32 *data32s, int len);
-bool prs_buffer5(bool charmode, const char *name, prs_struct *ps, int depth, BUFFER5 *str);
 bool prs_unistr2(bool charmode, const char *name, prs_struct *ps, int depth, UNISTR2 *str);
-bool prs_unistr3(bool charmode, const char *name, UNISTR3 *str, prs_struct *ps, int depth);
 bool prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str);
 bool prs_string(const char *name, prs_struct *ps, int depth, char *str, int max_buf_size);
 bool prs_string_alloc(const char *name, prs_struct *ps, int depth, const char **str);
index 37dffbb00592941b8d76005b6d0192f7e6b98196..cdcfb01eff23e0dd325a085eb8742d983cdfaaf6 100644 (file)
@@ -99,17 +99,6 @@ typedef struct policy_handle POLICY_HND;
                ((unsigned int)sys_getpid() )
 
 
-/********************************************************************** 
- * Buffers use by spoolss (i might be able to replace it with
- * an RPC_DATA_BLOB)
- **********************************************************************/
-
-typedef struct {
-       uint32 buf_len;
-       uint16 *buffer; /* data */
-} BUFFER5;
-
-
 /********************************************************************** 
  * UNICODE string variations
  **********************************************************************/
@@ -130,14 +119,6 @@ typedef struct {           /* UNISTR2 - unicode string size (in
                                  should include the NULL character */
 } UNISTR2;
 
-/* i think this is the same as a BUFFER5 used in the spoolss code --jerry */
-/* not sure about how the termination matches between the uint16 buffers thought */
-
-typedef struct {               /* UNISTR3 - XXXX not sure about this structure */
-       uint32 uni_str_len;
-       UNISTR str;
-} UNISTR3;
-
 /*
  * I'm really wondering how many different time formats
  * I will have to cope with
index 4e78d1b0642e55134d4f79eba57021b59f04ba6a..840e8e06da7670f7e12868bc34f4bc64470f6984 100644 (file)
@@ -383,22 +383,6 @@ void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen)
        pull_ucs2(NULL, dest, str->buffer, maxlen, str->uni_str_len*2, STR_NOALIGN);
 }
 
-#if 0
-/*******************************************************************
- Convert a (little-endian) UNISTR3 structure to an ASCII string.
-********************************************************************/
-
-void unistr3_to_ascii(char *dest, const UNISTR3 *str, size_t maxlen)
-{
-       if ((str == NULL) || (str->uni_str_len == 0)) {
-               *dest='\0';
-               return;
-       }
-       pull_ucs2(NULL, dest, str->str.buffer, maxlen, str->uni_str_len*2,
-                 STR_NOALIGN);
-}
-#endif
-
 /*******************************************************************
  Duplicate a UNISTR2 string into a null terminated char*
  using a talloc context.
index d966790249ba373cf5b60f06c2d8e44fdaa8581c..bddd4212dc5b1e9695a36e03c34fbb40e066800a 100644 (file)
@@ -213,30 +213,6 @@ bool smb_io_unistr(const char *desc, UNISTR *uni, prs_struct *ps, int depth)
        return True;
 }
 
-/*******************************************************************
-reads or writes a BUFFER5 structure.
-the buf_len member tells you how large the buffer is.
-********************************************************************/
-bool smb_io_buffer5(const char *desc, BUFFER5 *buf5, prs_struct *ps, int depth)
-{
-       prs_debug(ps, depth, desc, "smb_io_buffer5");
-       depth++;
-
-       if (buf5 == NULL) return False;
-
-       if(!prs_align(ps))
-               return False;
-       if(!prs_uint32("buf_len", ps, depth, &buf5->buf_len))
-               return False;
-
-       if(buf5->buf_len) {
-               if(!prs_buffer5(True, "buffer" , ps, depth, buf5))
-                       return False;
-       }
-
-       return True;
-}
-
 /*******************************************************************
 creates a UNISTR2 structure: sets up the buffer, too
 ********************************************************************/
@@ -574,63 +550,6 @@ bool smb_io_pol_hnd(const char *desc, POLICY_HND *pol, prs_struct *ps, int depth
        return True;
 }
 
-/*******************************************************************
- Create a UNISTR3.
-********************************************************************/
-
-void init_unistr3(UNISTR3 *str, const char *buf)
-{
-       if (buf == NULL) {
-               str->uni_str_len=0;
-               str->str.buffer = NULL;
-               return;
-       }
-
-       str->uni_str_len = strlen(buf) + 1;
-
-       if (str->uni_str_len) {
-               str->str.buffer = TALLOC_ZERO_ARRAY(talloc_tos(), uint16, str->uni_str_len);
-               if (str->str.buffer == NULL)
-                       smb_panic("init_unistr3: malloc fail");
-
-               rpcstr_push((char *)str->str.buffer, buf, str->uni_str_len * sizeof(uint16), STR_TERMINATE);
-       } else {
-               str->str.buffer = NULL;
-       }
-}
-
-/*******************************************************************
- Reads or writes a UNISTR3 structure.
-********************************************************************/
-
-bool smb_io_unistr3(const char *desc, UNISTR3 *name, prs_struct *ps, int depth)
-{
-       if (name == NULL)
-               return False;
-
-       prs_debug(ps, depth, desc, "smb_io_unistr3");
-       depth++;
-
-       if(!prs_align(ps))
-               return False;
-       
-       if(!prs_uint32("uni_str_len", ps, depth, &name->uni_str_len))
-               return False;
-               
-       /* we're done if there is no string */
-       
-       if ( name->uni_str_len == 0 )
-               return True;
-
-       /* don't know if len is specified by uni_str_len member... */
-       /* assume unicode string is unicode-null-terminated, instead */
-
-       if(!prs_unistr3(True, "unistr", name, ps, depth))
-               return False;
-
-       return True;
-}
-
 /*******************************************************************
 return the length of a UNISTR string.
 ********************************************************************/  
index c42018947ff33c4a0a62991c6ed4a6f2cb4bb163..94732b0a740342fa7166f453f0bcd7d3b148b91c 100644 (file)
@@ -1048,37 +1048,6 @@ bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uin
        return True;
 }
 
-/******************************************************************
- Stream an array of unicode string, length/buffer specified separately,
- in uint16 chars. The unicode string is already in little-endian format.
- ********************************************************************/
-
-bool prs_buffer5(bool charmode, const char *name, prs_struct *ps, int depth, BUFFER5 *str)
-{
-       char *p;
-       char *q = prs_mem_get(ps, str->buf_len * sizeof(uint16));
-       if (q == NULL)
-               return False;
-
-       /* If the string is empty, we don't have anything to stream */
-       if (str->buf_len==0)
-               return True;
-
-       if (UNMARSHALLING(ps)) {
-               str->buffer = PRS_ALLOC_MEM(ps,uint16,str->buf_len);
-               if (str->buffer == NULL)
-                       return False;
-       }
-
-       p = (char *)str->buffer;
-
-       dbg_rw_punival(charmode, name, depth, ps, q, p, str->buf_len);
-       
-       ps->data_offset += (str->buf_len * sizeof(uint16));
-
-       return True;
-}
-
 /******************************************************************
  Stream a unicode string, length/buffer specified separately,
  in uint16 chars. The unicode string is already in little-endian format.
@@ -1117,36 +1086,6 @@ bool prs_unistr2(bool charmode, const char *name, prs_struct *ps, int depth, UNI
        return True;
 }
 
-/******************************************************************
- Stream a unicode string, length/buffer specified separately,
- in uint16 chars. The unicode string is already in little-endian format.
- ********************************************************************/
-
-bool prs_unistr3(bool charmode, const char *name, UNISTR3 *str, prs_struct *ps, int depth)
-{
-       char *p;
-       char *q = prs_mem_get(ps, str->uni_str_len * sizeof(uint16));
-       if (q == NULL)
-               return False;
-
-       if (UNMARSHALLING(ps)) {
-               if (str->uni_str_len) {
-                       str->str.buffer = PRS_ALLOC_MEM(ps,uint16,str->uni_str_len);
-                       if (str->str.buffer == NULL)
-                               return False;
-               } else {
-                       str->str.buffer = NULL;
-               }
-       }
-
-       p = (char *)str->str.buffer;
-
-       dbg_rw_punival(charmode, name, depth, ps, q, p, str->uni_str_len);
-       ps->data_offset += (str->uni_str_len * sizeof(uint16));
-
-       return True;
-}
-
 /*******************************************************************
  Stream a unicode  null-terminated string. As the string is already
  in little-endian format then do it as a stream of bytes.