Merge from HEAD - make Samba compile with -Wwrite-strings without additional
[vlendec/samba-autobuild/.git] / source3 / rpc_parse / parse_dfs.c
index 6e30c66ac1368aea1dd21115c889c57e144834fa..ccd6d429fa806b86d6e78123f780cb65ed5432fd 100644 (file)
@@ -1,6 +1,5 @@
 /* 
- *  Unix SMB/Netbios implementation.
- *  Version 1.9.
+ *  Unix SMB/CIFS implementation.
  *  MSDfs RPC Pipe client / server routines
  *  Copyright (C) Andrew Tridgell              1992-2000,
  *  Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
@@ -26,7 +25,8 @@
 #include "nterr.h"
 #include "rpc_parse.h"   
 
-extern int DEBUGLEVEL;
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_RPC_PARSE
 
 /******************************************************************* 
 Make a DFS_Q_DFS_QUERY structure
@@ -41,7 +41,7 @@ void init_dfs_q_dfs_exist(DFS_Q_DFS_EXIST *q_d)
  Read/write a DFS_Q_DFS_EXIST structure - dummy...
  ************************************************************/
 
-BOOL dfs_io_q_dfs_exist(char *desc, DFS_Q_DFS_EXIST *q_d, prs_struct *ps, int depth)
+BOOL dfs_io_q_dfs_exist(const char *desc, DFS_Q_DFS_EXIST *q_d, prs_struct *ps, int depth)
 {
        if(q_d == NULL)
                return False;
@@ -55,7 +55,7 @@ BOOL dfs_io_q_dfs_exist(char *desc, DFS_Q_DFS_EXIST *q_d, prs_struct *ps, int de
  Read/write a DFS_R_DFS_EXIST structure
  ************************************************************/
 
-BOOL dfs_io_r_dfs_exist(char *desc, DFS_R_DFS_EXIST *q_d, prs_struct *ps, int depth)
+BOOL dfs_io_r_dfs_exist(const char *desc, DFS_R_DFS_EXIST *q_d, prs_struct *ps, int depth)
 {
        if(q_d == NULL)
                return False;
@@ -91,7 +91,7 @@ BOOL init_dfs_q_dfs_remove(DFS_Q_DFS_REMOVE *q_d, char *entrypath,
 Read/write a DFS_Q_DFS_REMOVE structure
 *******************************************************************/
 
-BOOL dfs_io_q_dfs_remove(char *desc, DFS_Q_DFS_REMOVE *q_d, prs_struct *ps, int depth)
+BOOL dfs_io_q_dfs_remove(const char *desc, DFS_Q_DFS_REMOVE *q_d, prs_struct *ps, int depth)
 {
        if(q_d == NULL)
                return False;
@@ -131,7 +131,7 @@ BOOL dfs_io_q_dfs_remove(char *desc, DFS_Q_DFS_REMOVE *q_d, prs_struct *ps, int
 Read/write a DFS_R_DFS_REMOVE structure
 *******************************************************************/
 
-BOOL dfs_io_r_dfs_remove(char *desc, DFS_R_DFS_REMOVE *r_d, prs_struct *ps, int depth)
+BOOL dfs_io_r_dfs_remove(const char *desc, DFS_R_DFS_REMOVE *r_d, prs_struct *ps, int depth)
 {
        if(r_d == NULL) 
                return False;
@@ -139,7 +139,7 @@ BOOL dfs_io_r_dfs_remove(char *desc, DFS_R_DFS_REMOVE *r_d, prs_struct *ps, int
        prs_debug(ps, depth, desc, "dfs_io_r_dfs_remove");
        depth++;
 
-       if(!prs_ntstatus("status", ps, depth, &r_d->status))
+       if(!prs_werror("status", ps, depth, &r_d->status))
                return False;
 
        return True;
@@ -172,7 +172,7 @@ BOOL init_dfs_q_dfs_add(DFS_Q_DFS_ADD *q_d, char *entrypath, char *servername,
  Read/write a DFS_Q_DFS_ADD structure
  ************************************************************/
 
-BOOL dfs_io_q_dfs_add(char *desc, DFS_Q_DFS_ADD *q_d, prs_struct *ps, int depth)
+BOOL dfs_io_q_dfs_add(const char *desc, DFS_Q_DFS_ADD *q_d, prs_struct *ps, int depth)
 {
        if(q_d == NULL)
                return False;
@@ -217,7 +217,7 @@ BOOL dfs_io_q_dfs_add(char *desc, DFS_Q_DFS_ADD *q_d, prs_struct *ps, int depth)
  Read/write a DFS_R_DFS_ADD structure 
  ************************************************************/
 
-BOOL dfs_io_r_dfs_add(char *desc, DFS_R_DFS_ADD *r_d, prs_struct *ps, int depth)
+BOOL dfs_io_r_dfs_add(const char *desc, DFS_R_DFS_ADD *r_d, prs_struct *ps, int depth)
 {
        if(r_d == NULL)
                return False;
@@ -225,7 +225,7 @@ BOOL dfs_io_r_dfs_add(char *desc, DFS_R_DFS_ADD *r_d, prs_struct *ps, int depth)
        prs_debug(ps, depth, desc, "dfs_io_r_dfs_add");
        depth++;
 
-       if(!prs_ntstatus("status", ps, depth, &r_d->status))
+       if(!prs_werror("status", ps, depth, &r_d->status))
                return False;
 
        return True;
@@ -248,7 +248,7 @@ BOOL init_dfs_q_dfs_get_info(DFS_Q_DFS_GET_INFO *q_d, char *entrypath,
  Read/write a DFS_Q_GET_INFO structure
  ************************************************************/
 
-BOOL dfs_io_q_dfs_get_info(char* desc, DFS_Q_DFS_GET_INFO* q_i, prs_struct* ps, int depth)
+BOOL dfs_io_q_dfs_get_info(const char *desc, DFS_Q_DFS_GET_INFO* q_i, prs_struct* ps, int depth)
 {
        if(q_i == NULL)
                return False;
@@ -288,7 +288,7 @@ BOOL dfs_io_q_dfs_get_info(char* desc, DFS_Q_DFS_GET_INFO* q_i, prs_struct* ps,
  Read/write a DFS_R_GET_INFO structure
  ************************************************************/
 
-BOOL dfs_io_r_dfs_get_info(char* desc, DFS_R_DFS_GET_INFO* r_i, prs_struct* ps, int depth)
+BOOL dfs_io_r_dfs_get_info(const char *desc, DFS_R_DFS_GET_INFO* r_i, prs_struct* ps, int depth)
 {
        if(r_i == NULL)
                return False;
@@ -300,7 +300,7 @@ BOOL dfs_io_r_dfs_get_info(char* desc, DFS_R_DFS_GET_INFO* r_i, prs_struct* ps,
 
        if(!dfs_io_dfs_info_ctr("", &r_i->ctr, 1, r_i->level, ps, depth))
                return False;
-       if(!prs_ntstatus("status", ps, depth, &r_i->status))
+       if(!prs_werror("status", ps, depth, &r_i->status))
                return False;
        return True;
 }
@@ -327,7 +327,7 @@ BOOL init_dfs_q_dfs_enum(DFS_Q_DFS_ENUM *q_d, uint32 level, DFS_INFO_CTR *ctr)
  Read or write the DFS_Q_DFS_ENUM structure 
  ************************************************************/
 
-BOOL dfs_io_q_dfs_enum(char *desc, DFS_Q_DFS_ENUM *q_d, prs_struct *ps, int depth)
+BOOL dfs_io_q_dfs_enum(const char *desc, DFS_Q_DFS_ENUM *q_d, prs_struct *ps, int depth)
 {
        if(q_d == NULL)
                return False;
@@ -364,7 +364,7 @@ BOOL dfs_io_q_dfs_enum(char *desc, DFS_Q_DFS_ENUM *q_d, prs_struct *ps, int dept
  Read/write a DFS_INFO_CTR structure
  ************************************************************/
 
-BOOL dfs_io_dfs_info_ctr(char* desc, DFS_INFO_CTR* ctr, uint32 num_entries, uint32 level, prs_struct* ps, int depth)
+BOOL dfs_io_dfs_info_ctr(const char *desc, DFS_INFO_CTR* ctr, uint32 num_entries, uint32 level, prs_struct* ps, int depth)
 {
        int i=0;
 
@@ -464,7 +464,7 @@ BOOL dfs_io_dfs_info_ctr(char* desc, DFS_INFO_CTR* ctr, uint32 num_entries, uint
  Read/write a DFS_R_DFS_ENUM structure
  ************************************************************/
 
-BOOL dfs_io_r_dfs_enum(char *desc, DFS_R_DFS_ENUM *q_d, prs_struct *ps, int depth)
+BOOL dfs_io_r_dfs_enum(const char *desc, DFS_R_DFS_ENUM *q_d, prs_struct *ps, int depth)
 {
        DFS_INFO_CTR *ctr;
        if(q_d == NULL)
@@ -501,12 +501,12 @@ BOOL dfs_io_r_dfs_enum(char *desc, DFS_R_DFS_ENUM *q_d, prs_struct *ps, int dept
 
        if(!smb_io_enum_hnd("resume_hnd", &q_d->reshnd, ps, depth))
                return False;
-       if(!prs_ntstatus("status", ps, depth, &q_d->status))
+       if(!prs_werror("status", ps, depth, &q_d->status))
                return False;
        return True;
 }
 
-BOOL dfs_io_dfs_storage_info(char *desc, DFS_INFO_3* info3, prs_struct *ps, int depth)
+BOOL dfs_io_dfs_storage_info(const char *desc, DFS_INFO_3* info3, prs_struct *ps, int depth)
 {
        int i=0;
        if(info3 == NULL)