]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Use pidl for _srvsvc_NetRemoteTOD().
authorGünther Deschner <gd@samba.org>
Wed, 5 Mar 2008 09:34:45 +0000 (10:34 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 5 Mar 2008 09:34:45 +0000 (10:34 +0100)
Guenther

source/rpc_client/init_srvsvc.c
source/rpc_server/srv_srvsvc.c
source/rpc_server/srv_srvsvc_nt.c

index a4ee54cb48f4a3ccc006357c5df7e346099f5caf..5e868ffd2b90f425f8fcdaef6827a0137962463e 100644 (file)
@@ -84,3 +84,36 @@ void init_srvsvc_NetSrvInfo100(struct srvsvc_NetSrvInfo100 *r,
        r->platform_id = platform_id;
        r->server_name = server_name;
 }
+
+/*******************************************************************
+ inits a srvsvc_NetRemoteTODInfo structure
+ ********************************************************************/
+
+void init_srvsvc_NetRemoteTODInfo(struct srvsvc_NetRemoteTODInfo *r,
+                                 uint32_t elapsed,
+                                 uint32_t msecs,
+                                 uint32_t hours,
+                                 uint32_t mins,
+                                 uint32_t secs,
+                                 uint32_t hunds,
+                                 int32_t ttimezone,
+                                 uint32_t tinterval,
+                                 uint32_t day,
+                                 uint32_t month,
+                                 uint32_t year,
+                                 uint32_t weekday)
+{
+       r->elapsed = elapsed;
+       r->msecs = msecs;
+       r->hours = hours;
+       r->mins = mins;
+       r->secs = secs;
+       r->hunds = hunds;
+       r->timezone = ttimezone;
+       r->tinterval = tinterval;
+       r->day = day;
+       r->month = month;
+       r->year = year;
+       r->weekday = weekday;
+}
+
index 0d50bccef0437e5ab466af9623f4ca006348d7c0..41fc39baf7d6388373612fdc30210820cf4a785f 100644 (file)
@@ -369,25 +369,7 @@ static bool api_srv_net_share_del_sticky(pipes_struct *p)
 
 static bool api_srv_net_remote_tod(pipes_struct *p)
 {
-       SRV_Q_NET_REMOTE_TOD q_u;
-       SRV_R_NET_REMOTE_TOD r_u;
-       prs_struct *data = &p->in_data.data;
-       prs_struct *rdata = &p->out_data.rdata;
-
-       ZERO_STRUCT(q_u);
-       ZERO_STRUCT(r_u);
-
-       /* grab the net server get enum */
-       if(!srv_io_q_net_remote_tod("", &q_u, data, 0))
-               return False;
-
-       r_u.status = _srv_net_remote_tod(p, &q_u, &r_u);
-
-       /* store the response in the SMB stream */
-       if(!srv_io_r_net_remote_tod("", &r_u, rdata, 0))
-               return False;
-
-       return True;
+       return proxy_srvsvc_call(p, NDR_SRVSVC_NETREMOTETOD);
 }
 
 /*******************************************************************
index 75c262a7a6d4ffa52ab29e7ca0a3502b861656bd..4efea33738055a9e2bb6cd6e1ed56abaa4d58285 100644 (file)
@@ -2054,12 +2054,13 @@ WERROR _srv_net_share_del_sticky(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_
 }
 
 /*******************************************************************
-time of day
+ _srvsvc_NetRemoteTOD
 ********************************************************************/
 
-WERROR _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET_REMOTE_TOD *r_u)
+WERROR _srvsvc_NetRemoteTOD(pipes_struct *p,
+                           struct srvsvc_NetRemoteTOD *r)
 {
-       TIME_OF_DAY_INFO *tod;
+       struct srvsvc_NetRemoteTODInfo *tod;
        struct tm *t;
        time_t unixdate = time(NULL);
 
@@ -2068,37 +2069,35 @@ WERROR _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET
 
        uint32 zone = get_time_zone(unixdate)/60;
 
-       DEBUG(5,("_srv_net_remote_tod: %d\n", __LINE__));
+       DEBUG(5,("_srvsvc_NetRemoteTOD: %d\n", __LINE__));
 
-       if ( !(tod = TALLOC_ZERO_P(p->mem_ctx, TIME_OF_DAY_INFO)) )
+       if ( !(tod = TALLOC_ZERO_P(p->mem_ctx, struct srvsvc_NetRemoteTODInfo)) )
                return WERR_NOMEM;
 
-       r_u->tod = tod;
-       r_u->ptr_srv_tod = 0x1;
-       r_u->status = WERR_OK;
+       *r->out.info = tod;
 
-       DEBUG(5,("_srv_net_remote_tod: %d\n", __LINE__));
+       DEBUG(5,("_srvsvc_NetRemoteTOD: %d\n", __LINE__));
 
        t = gmtime(&unixdate);
 
        /* set up the */
-       init_time_of_day_info(tod,
-                             unixdate,
-                             0,
-                             t->tm_hour,
-                             t->tm_min,
-                             t->tm_sec,
-                             0,
-                             zone,
-                             10000,
-                             t->tm_mday,
-                             t->tm_mon + 1,
-                             1900+t->tm_year,
-                             t->tm_wday);
-
-       DEBUG(5,("_srv_net_remote_tod: %d\n", __LINE__));
+       init_srvsvc_NetRemoteTODInfo(tod,
+                                    unixdate,
+                                    0,
+                                    t->tm_hour,
+                                    t->tm_min,
+                                    t->tm_sec,
+                                    0,
+                                    zone,
+                                    10000,
+                                    t->tm_mday,
+                                    t->tm_mon + 1,
+                                    1900+t->tm_year,
+                                    t->tm_wday);
 
-       return r_u->status;
+       DEBUG(5,("_srvsvc_NetRemoteTOD: %d\n", __LINE__));
+
+       return WERR_OK;
 }
 
 /***********************************************************************************
@@ -2597,12 +2596,6 @@ WERROR _srvsvc_NetTransportDel(pipes_struct *p, struct srvsvc_NetTransportDel *r
        return WERR_NOT_SUPPORTED;
 }
 
-WERROR _srvsvc_NetRemoteTOD(pipes_struct *p, struct srvsvc_NetRemoteTOD *r)
-{
-       p->rng_fault_state = True;
-       return WERR_NOT_SUPPORTED;
-}
-
 WERROR _srvsvc_NetSetServiceBits(pipes_struct *p, struct srvsvc_NetSetServiceBits *r)
 {
        p->rng_fault_state = True;