Remove unused marshalling for NET_SAM_DELTAS.
authorGünther Deschner <gd@samba.org>
Fri, 15 Feb 2008 01:59:48 +0000 (02:59 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 15 Feb 2008 13:06:50 +0000 (14:06 +0100)
Guenther

source/include/rpc_netlogon.h
source/rpc_client/cli_netlogon.c
source/rpc_parse/parse_net.c

index c8a25cdf4d607dcb93fa163b149617be7f41763b..93b50c9c00bbdc5bb67b0f2816098e0a1ead9bad 100644 (file)
@@ -831,35 +831,6 @@ typedef struct net_r_sam_sync_info {
        NTSTATUS status;
 } NET_R_SAM_SYNC;
 
-/* NET_Q_SAM_DELTAS */
-typedef struct net_q_sam_deltas_info {
-       UNISTR2 uni_srv_name;
-       UNISTR2 uni_cli_name;
-       DOM_CRED cli_creds;
-       DOM_CRED ret_creds;
-
-       uint32 database_id;
-       uint64 dom_mod_count;  /* domain mod count at last sync */
-
-       uint32 max_size;       /* preferred maximum length */
-} NET_Q_SAM_DELTAS;
-
-/* NET_R_SAM_DELTAS */
-typedef struct net_r_sam_deltas_info {
-       DOM_CRED srv_creds;
-
-       uint64 dom_mod_count;   /* new domain mod count */
-
-       uint32 ptr_deltas;
-       uint32 num_deltas;
-       uint32 num_deltas2;
-
-       SAM_DELTA_HDR *hdr_deltas;
-       SAM_DELTA_CTR *deltas;
-
-       NTSTATUS status;
-} NET_R_SAM_DELTAS;
-
 #define DSGETDC_VALID_FLAGS ( \
     DS_FORCE_REDISCOVERY | \
     DS_DIRECTORY_SERVICE_REQUIRED | \
index d28df3c164b8d47867f72ceb57a903f536939682..0da482c9ef340fa633661a511b27d3e9b871eb27 100644 (file)
@@ -400,58 +400,6 @@ NTSTATUS rpccli_netlogon_sam_sync(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
        return result;
 }
 
-/* Sam synchronisation */
-
-NTSTATUS rpccli_netlogon_sam_deltas(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
-                                 uint32 database_id, uint64 seqnum,
-                                 uint32 *num_deltas, 
-                                 SAM_DELTA_HDR **hdr_deltas, 
-                                 SAM_DELTA_CTR **deltas)
-{
-       prs_struct qbuf, rbuf;
-       NET_Q_SAM_DELTAS q;
-       NET_R_SAM_DELTAS r;
-       NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-        DOM_CRED clnt_creds;
-
-       ZERO_STRUCT(q);
-       ZERO_STRUCT(r);
-
-       /* Initialise input parameters */
-
-       creds_client_step(cli->dc, &clnt_creds);
-
-       init_net_q_sam_deltas(&q, cli->dc->remote_machine,
-                              global_myname(), &clnt_creds, 
-                              database_id, seqnum);
-
-       /* Marshall data and send request */
-
-       CLI_DO_RPC(cli, mem_ctx, PI_NETLOGON, NET_SAM_DELTAS,
-               q, r,
-               qbuf, rbuf,
-               net_io_q_sam_deltas,
-               net_io_r_sam_deltas,
-               NT_STATUS_UNSUCCESSFUL);
-
-        /* Return results */
-
-       result = r.status;
-        *num_deltas = r.num_deltas2;
-        *hdr_deltas = r.hdr_deltas;
-        *deltas = r.deltas;
-
-       if (!NT_STATUS_IS_ERR(result)) {
-               /* Check returned credentials. */
-               if (!creds_client_check(cli->dc, &r.srv_creds.challenge)) {
-                       DEBUG(0,("cli_netlogon_sam_sync: credentials chain check failed\n"));
-                       return NT_STATUS_ACCESS_DENIED;
-               }
-       }
-
-       return result;
-}
-
 /* Logon domain user */
 
 NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli,
index 8105ac547041afa3641bf7d52c382eab17fc6d18..b4ed470cce8f5f2de2e187bd3e58f24fc2670f1a 100644 (file)
@@ -2571,138 +2571,3 @@ bool net_io_r_sam_sync(const char *desc,
 
        return True;
 }
-
-/*******************************************************************
-makes a NET_Q_SAM_DELTAS structure.
-********************************************************************/
-bool init_net_q_sam_deltas(NET_Q_SAM_DELTAS *q_s, const char *srv_name, 
-                           const char *cli_name, DOM_CRED *cli_creds, 
-                           uint32 database_id, uint64 dom_mod_count)
-{
-       DEBUG(5, ("init_net_q_sam_deltas\n"));
-
-       init_unistr2(&q_s->uni_srv_name, srv_name, UNI_STR_TERMINATE);
-       init_unistr2(&q_s->uni_cli_name, cli_name, UNI_STR_TERMINATE);
-
-       memcpy(&q_s->cli_creds, cli_creds, sizeof(q_s->cli_creds));
-       memset(&q_s->ret_creds, 0, sizeof(q_s->ret_creds));
-
-       q_s->database_id = database_id;
-    q_s->dom_mod_count = dom_mod_count;
-       q_s->max_size = 0xffff;
-
-       return True;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-bool net_io_q_sam_deltas(const char *desc, NET_Q_SAM_DELTAS *q_s, prs_struct *ps,
-                         int depth)
-{
-       prs_debug(ps, depth, desc, "net_io_q_sam_deltas");
-       depth++;
-
-       if (!smb_io_unistr2("", &q_s->uni_srv_name, True, ps, depth))
-                return False;
-       if (!smb_io_unistr2("", &q_s->uni_cli_name, True, ps, depth))
-                return False;
-
-       if (!smb_io_cred("", &q_s->cli_creds, ps, depth))
-                return False;
-       if (!smb_io_cred("", &q_s->ret_creds, ps, depth))
-                return False;
-
-       if (!prs_uint32("database_id  ", ps, depth, &q_s->database_id))
-                return False;
-        if (!prs_uint64("dom_mod_count", ps, depth, &q_s->dom_mod_count))
-                return False;
-       if (!prs_uint32("max_size", ps, depth, &q_s->max_size))
-                return False;
-
-       return True;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-bool net_io_r_sam_deltas(const char *desc,
-                         NET_R_SAM_DELTAS *r_s, prs_struct *ps, int depth)
-{
-        unsigned int i;
-
-       prs_debug(ps, depth, desc, "net_io_r_sam_deltas");
-       depth++;
-
-       if (!smb_io_cred("srv_creds", &r_s->srv_creds, ps, depth))
-                return False;
-        if (!prs_uint64("dom_mod_count", ps, depth, &r_s->dom_mod_count))
-                return False;
-
-       if (!prs_uint32("ptr_deltas", ps, depth, &r_s->ptr_deltas))
-                return False;
-       if (!prs_uint32("num_deltas", ps, depth, &r_s->num_deltas))
-                return False;
-       if (!prs_uint32("ptr_deltas2", ps, depth, &r_s->num_deltas2))
-                return False;
-
-       if (r_s->num_deltas2 != 0)
-       {
-               if (!prs_uint32("num_deltas2 ", ps, depth, &r_s->num_deltas2))
-                        return False;
-
-               if (r_s->ptr_deltas != 0)
-               {
-                       if (UNMARSHALLING(ps)) {
-                               if (r_s->num_deltas) {
-                                       r_s->hdr_deltas = TALLOC_ARRAY(ps->mem_ctx, SAM_DELTA_HDR, r_s->num_deltas);
-                                       if (r_s->hdr_deltas == NULL) {
-                                               DEBUG(0, ("error tallocating memory "
-                                                       "for %d delta headers\n", 
-                                                       r_s->num_deltas));
-                                               return False;
-                                       }
-                               } else {
-                                       r_s->hdr_deltas = NULL;
-                               }
-                       }
-
-                       for (i = 0; i < r_s->num_deltas; i++)
-                       {
-                               net_io_sam_delta_hdr("", &r_s->hdr_deltas[i],
-                                                      ps, depth);
-                       }
-                        
-                       if (UNMARSHALLING(ps)) {
-                               if (r_s->num_deltas) {
-                                       r_s->deltas = TALLOC_ARRAY(ps->mem_ctx, SAM_DELTA_CTR, r_s->num_deltas);
-                                       if (r_s->deltas == NULL) {
-                                               DEBUG(0, ("error tallocating memory "
-                                                       "for %d deltas\n", 
-                                                       r_s->num_deltas));
-                                               return False;
-                                       }
-                               } else {
-                                       r_s->deltas = NULL;
-                               }
-                       }
-
-                       for (i = 0; i < r_s->num_deltas; i++)
-                       {
-                               if (!net_io_sam_delta_ctr(
-                                        "",
-                                        &r_s->deltas[i],
-                                        r_s->hdr_deltas[i].type2,
-                                        ps, depth))
-                                        
-                                        return False;
-                       }
-               }
-       }
-
-       prs_align(ps);
-       if (!prs_ntstatus("status", ps, depth, &r_s->status))
-                return False;
-
-       return True;
-}