summaryrefslogtreecommitdiff
path: root/source3/librpc/gen_ndr
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-09-04 15:13:22 +0200
committerGünther Deschner <gd@samba.org>2008-09-12 14:09:42 +0200
commit3f41545b61723f076c41e446cfec90fd08bd16ae (patch)
treee1291d7adb8ce2b8d565e7450ef13715da689f5a /source3/librpc/gen_ndr
parent41ebc6fe73fc2a2ad845c2ad0109222612edf1a3 (diff)
downloadsamba-3f41545b61723f076c41e446cfec90fd08bd16ae.tar.gz
samba-3f41545b61723f076c41e446cfec90fd08bd16ae.tar.bz2
samba-3f41545b61723f076c41e446cfec90fd08bd16ae.zip
messaging: move types to IDL.
Guenther (This used to be commit 6c346d0eb20af5ba9b09f30319420f7c91480da6)
Diffstat (limited to 'source3/librpc/gen_ndr')
-rw-r--r--source3/librpc/gen_ndr/messaging.h116
-rw-r--r--source3/librpc/gen_ndr/ndr_messaging.c81
-rw-r--r--source3/librpc/gen_ndr/ndr_messaging.h3
3 files changed, 196 insertions, 4 deletions
diff --git a/source3/librpc/gen_ndr/messaging.h b/source3/librpc/gen_ndr/messaging.h
index ca13b7cdea..3324160938 100644
--- a/source3/librpc/gen_ndr/messaging.h
+++ b/source3/librpc/gen_ndr/messaging.h
@@ -5,9 +5,123 @@
#ifndef _HEADER_messaging
#define _HEADER_messaging
+#define MSG_TYPE_MASK ( 0xFFFF )
+enum messaging_type
+#ifndef USE_UINT_ENUMS
+ {
+ MSG_DEBUG=0x0001,
+ MSG_PING=0x0002,
+ MSG_PONG=0x0003,
+ MSG_PROFILE=0x0004,
+ MSG_REQ_DEBUGLEVEL=0x0005,
+ MSG_DEBUGLEVEL=0x0006,
+ MSG_REQ_PROFILELEVEL=0x0007,
+ MSG_PROFILELEVEL=0x0008,
+ MSG_REQ_POOL_USAGE=0x0009,
+ MSG_POOL_USAGE=0x000A,
+ MSG_REQ_DMALLOC_MARK=0x000B,
+ MSG_REQ_DMALLOC_LOG_CHANGED=0x000C,
+ MSG_SHUTDOWN=0x000D,
+ MSG_FORCE_ELECTION=0x0101,
+ MSG_WINS_NEW_ENTRY=0x0102,
+ MSG_SEND_PACKET=0x0103,
+ MSG_PRINTER_NOTIFY=0x2001,
+ MSG_PRINTER_NOTIFY2=0x0202,
+ MSG_PRINTER_DRVUPGRADE=0x0203,
+ MSG_PRINTERDATA_INIT_RESET=0x0204,
+ MSG_PRINTER_UPDATE=0x0205,
+ MSG_PRINTER_MOD=0x0206,
+ MSG_SMB_CONF_UPDATED=0x0301,
+ MSG_SMB_FORCE_TDIS=0x0302,
+ MSG_SMB_SAM_SYNC=0x0303,
+ MSG_SMB_SAM_REPL=0x0304,
+ MSG_SMB_UNLOCK=0x0305,
+ MSG_SMB_BREAK_REQUEST=0x0306,
+ MSG_SMB_BREAK_RESPONSE=0x0307,
+ MSG_SMB_ASYNC_LEVEL2_BREAK=0x0308,
+ MSG_SMB_OPEN_RETRY=0x0309,
+ MSG_SMB_KERNEL_BREAK=0x030A,
+ MSG_SMB_FILE_RENAME=0x030B,
+ MSG_SMB_INJECT_FAULT=0x030C,
+ MSG_SMB_BLOCKING_LOCK_CANCEL=0x030D,
+ MSG_SMB_NOTIFY=0x030E,
+ MSG_SMB_STAT_CACHE_DELETE=0x030F,
+ MSG_PVFS_NOTIFY=0x0310,
+ MSG_SMB_BRL_VALIDATE=0x0311,
+ MSG_SMB_RELEASE_IP=0x0312,
+ MSG_SMB_CLOSE_FILE=0x0313,
+ MSG_WINBIND_FINISHED=0x0401,
+ MSG_WINBIND_FORGET_STATE=0x0402,
+ MSG_WINBIND_ONLINE=0x0403,
+ MSG_WINBIND_OFFLINE=0x0404,
+ MSG_WINBIND_ONLINESTATUS=0x0405,
+ MSG_WINBIND_TRY_TO_GO_ONLINE=0x0406,
+ MSG_WINBIND_FAILED_TO_GO_ONLINE=0x0407,
+ MSG_WINBIND_VALIDATE_CACHE=0x0408,
+ MSG_WINBIND_DUMP_DOMAIN_LIST=0x0409,
+ MSG_DUMP_EVENT_LIST=0x0500,
+ MSG_DBWRAP_TDB2_CHANGES=4001
+}
+#else
+ { __donnot_use_enum_messaging_type=0x7FFFFFFF}
+#define MSG_DEBUG ( 0x0001 )
+#define MSG_PING ( 0x0002 )
+#define MSG_PONG ( 0x0003 )
+#define MSG_PROFILE ( 0x0004 )
+#define MSG_REQ_DEBUGLEVEL ( 0x0005 )
+#define MSG_DEBUGLEVEL ( 0x0006 )
+#define MSG_REQ_PROFILELEVEL ( 0x0007 )
+#define MSG_PROFILELEVEL ( 0x0008 )
+#define MSG_REQ_POOL_USAGE ( 0x0009 )
+#define MSG_POOL_USAGE ( 0x000A )
+#define MSG_REQ_DMALLOC_MARK ( 0x000B )
+#define MSG_REQ_DMALLOC_LOG_CHANGED ( 0x000C )
+#define MSG_SHUTDOWN ( 0x000D )
+#define MSG_FORCE_ELECTION ( 0x0101 )
+#define MSG_WINS_NEW_ENTRY ( 0x0102 )
+#define MSG_SEND_PACKET ( 0x0103 )
+#define MSG_PRINTER_NOTIFY ( 0x2001 )
+#define MSG_PRINTER_NOTIFY2 ( 0x0202 )
+#define MSG_PRINTER_DRVUPGRADE ( 0x0203 )
+#define MSG_PRINTERDATA_INIT_RESET ( 0x0204 )
+#define MSG_PRINTER_UPDATE ( 0x0205 )
+#define MSG_PRINTER_MOD ( 0x0206 )
+#define MSG_SMB_CONF_UPDATED ( 0x0301 )
+#define MSG_SMB_FORCE_TDIS ( 0x0302 )
+#define MSG_SMB_SAM_SYNC ( 0x0303 )
+#define MSG_SMB_SAM_REPL ( 0x0304 )
+#define MSG_SMB_UNLOCK ( 0x0305 )
+#define MSG_SMB_BREAK_REQUEST ( 0x0306 )
+#define MSG_SMB_BREAK_RESPONSE ( 0x0307 )
+#define MSG_SMB_ASYNC_LEVEL2_BREAK ( 0x0308 )
+#define MSG_SMB_OPEN_RETRY ( 0x0309 )
+#define MSG_SMB_KERNEL_BREAK ( 0x030A )
+#define MSG_SMB_FILE_RENAME ( 0x030B )
+#define MSG_SMB_INJECT_FAULT ( 0x030C )
+#define MSG_SMB_BLOCKING_LOCK_CANCEL ( 0x030D )
+#define MSG_SMB_NOTIFY ( 0x030E )
+#define MSG_SMB_STAT_CACHE_DELETE ( 0x030F )
+#define MSG_PVFS_NOTIFY ( 0x0310 )
+#define MSG_SMB_BRL_VALIDATE ( 0x0311 )
+#define MSG_SMB_RELEASE_IP ( 0x0312 )
+#define MSG_SMB_CLOSE_FILE ( 0x0313 )
+#define MSG_WINBIND_FINISHED ( 0x0401 )
+#define MSG_WINBIND_FORGET_STATE ( 0x0402 )
+#define MSG_WINBIND_ONLINE ( 0x0403 )
+#define MSG_WINBIND_OFFLINE ( 0x0404 )
+#define MSG_WINBIND_ONLINESTATUS ( 0x0405 )
+#define MSG_WINBIND_TRY_TO_GO_ONLINE ( 0x0406 )
+#define MSG_WINBIND_FAILED_TO_GO_ONLINE ( 0x0407 )
+#define MSG_WINBIND_VALIDATE_CACHE ( 0x0408 )
+#define MSG_WINBIND_DUMP_DOMAIN_LIST ( 0x0409 )
+#define MSG_DUMP_EVENT_LIST ( 0x0500 )
+#define MSG_DBWRAP_TDB2_CHANGES ( 4001 )
+#endif
+;
+
struct messaging_rec {
uint32_t msg_version;
- uint32_t msg_type;
+ enum messaging_type msg_type;
struct server_id dest;
struct server_id src;
DATA_BLOB buf;
diff --git a/source3/librpc/gen_ndr/ndr_messaging.c b/source3/librpc/gen_ndr/ndr_messaging.c
index 6251c18ba3..e1e95eef4e 100644
--- a/source3/librpc/gen_ndr/ndr_messaging.c
+++ b/source3/librpc/gen_ndr/ndr_messaging.c
@@ -3,12 +3,87 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_messaging.h"
+_PUBLIC_ enum ndr_err_code ndr_push_messaging_type(struct ndr_push *ndr, int ndr_flags, enum messaging_type r)
+{
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_messaging_type(struct ndr_pull *ndr, int ndr_flags, enum messaging_type *r)
+{
+ uint32_t v;
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+ *r = v;
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_messaging_type(struct ndr_print *ndr, const char *name, enum messaging_type r)
+{
+ const char *val = NULL;
+
+ switch (r) {
+ case MSG_DEBUG: val = "MSG_DEBUG"; break;
+ case MSG_PING: val = "MSG_PING"; break;
+ case MSG_PONG: val = "MSG_PONG"; break;
+ case MSG_PROFILE: val = "MSG_PROFILE"; break;
+ case MSG_REQ_DEBUGLEVEL: val = "MSG_REQ_DEBUGLEVEL"; break;
+ case MSG_DEBUGLEVEL: val = "MSG_DEBUGLEVEL"; break;
+ case MSG_REQ_PROFILELEVEL: val = "MSG_REQ_PROFILELEVEL"; break;
+ case MSG_PROFILELEVEL: val = "MSG_PROFILELEVEL"; break;
+ case MSG_REQ_POOL_USAGE: val = "MSG_REQ_POOL_USAGE"; break;
+ case MSG_POOL_USAGE: val = "MSG_POOL_USAGE"; break;
+ case MSG_REQ_DMALLOC_MARK: val = "MSG_REQ_DMALLOC_MARK"; break;
+ case MSG_REQ_DMALLOC_LOG_CHANGED: val = "MSG_REQ_DMALLOC_LOG_CHANGED"; break;
+ case MSG_SHUTDOWN: val = "MSG_SHUTDOWN"; break;
+ case MSG_FORCE_ELECTION: val = "MSG_FORCE_ELECTION"; break;
+ case MSG_WINS_NEW_ENTRY: val = "MSG_WINS_NEW_ENTRY"; break;
+ case MSG_SEND_PACKET: val = "MSG_SEND_PACKET"; break;
+ case MSG_PRINTER_NOTIFY: val = "MSG_PRINTER_NOTIFY"; break;
+ case MSG_PRINTER_NOTIFY2: val = "MSG_PRINTER_NOTIFY2"; break;
+ case MSG_PRINTER_DRVUPGRADE: val = "MSG_PRINTER_DRVUPGRADE"; break;
+ case MSG_PRINTERDATA_INIT_RESET: val = "MSG_PRINTERDATA_INIT_RESET"; break;
+ case MSG_PRINTER_UPDATE: val = "MSG_PRINTER_UPDATE"; break;
+ case MSG_PRINTER_MOD: val = "MSG_PRINTER_MOD"; break;
+ case MSG_SMB_CONF_UPDATED: val = "MSG_SMB_CONF_UPDATED"; break;
+ case MSG_SMB_FORCE_TDIS: val = "MSG_SMB_FORCE_TDIS"; break;
+ case MSG_SMB_SAM_SYNC: val = "MSG_SMB_SAM_SYNC"; break;
+ case MSG_SMB_SAM_REPL: val = "MSG_SMB_SAM_REPL"; break;
+ case MSG_SMB_UNLOCK: val = "MSG_SMB_UNLOCK"; break;
+ case MSG_SMB_BREAK_REQUEST: val = "MSG_SMB_BREAK_REQUEST"; break;
+ case MSG_SMB_BREAK_RESPONSE: val = "MSG_SMB_BREAK_RESPONSE"; break;
+ case MSG_SMB_ASYNC_LEVEL2_BREAK: val = "MSG_SMB_ASYNC_LEVEL2_BREAK"; break;
+ case MSG_SMB_OPEN_RETRY: val = "MSG_SMB_OPEN_RETRY"; break;
+ case MSG_SMB_KERNEL_BREAK: val = "MSG_SMB_KERNEL_BREAK"; break;
+ case MSG_SMB_FILE_RENAME: val = "MSG_SMB_FILE_RENAME"; break;
+ case MSG_SMB_INJECT_FAULT: val = "MSG_SMB_INJECT_FAULT"; break;
+ case MSG_SMB_BLOCKING_LOCK_CANCEL: val = "MSG_SMB_BLOCKING_LOCK_CANCEL"; break;
+ case MSG_SMB_NOTIFY: val = "MSG_SMB_NOTIFY"; break;
+ case MSG_SMB_STAT_CACHE_DELETE: val = "MSG_SMB_STAT_CACHE_DELETE"; break;
+ case MSG_PVFS_NOTIFY: val = "MSG_PVFS_NOTIFY"; break;
+ case MSG_SMB_BRL_VALIDATE: val = "MSG_SMB_BRL_VALIDATE"; break;
+ case MSG_SMB_RELEASE_IP: val = "MSG_SMB_RELEASE_IP"; break;
+ case MSG_SMB_CLOSE_FILE: val = "MSG_SMB_CLOSE_FILE"; break;
+ case MSG_WINBIND_FINISHED: val = "MSG_WINBIND_FINISHED"; break;
+ case MSG_WINBIND_FORGET_STATE: val = "MSG_WINBIND_FORGET_STATE"; break;
+ case MSG_WINBIND_ONLINE: val = "MSG_WINBIND_ONLINE"; break;
+ case MSG_WINBIND_OFFLINE: val = "MSG_WINBIND_OFFLINE"; break;
+ case MSG_WINBIND_ONLINESTATUS: val = "MSG_WINBIND_ONLINESTATUS"; break;
+ case MSG_WINBIND_TRY_TO_GO_ONLINE: val = "MSG_WINBIND_TRY_TO_GO_ONLINE"; break;
+ case MSG_WINBIND_FAILED_TO_GO_ONLINE: val = "MSG_WINBIND_FAILED_TO_GO_ONLINE"; break;
+ case MSG_WINBIND_VALIDATE_CACHE: val = "MSG_WINBIND_VALIDATE_CACHE"; break;
+ case MSG_WINBIND_DUMP_DOMAIN_LIST: val = "MSG_WINBIND_DUMP_DOMAIN_LIST"; break;
+ case MSG_DUMP_EVENT_LIST: val = "MSG_DUMP_EVENT_LIST"; break;
+ case MSG_DBWRAP_TDB2_CHANGES: val = "MSG_DBWRAP_TDB2_CHANGES"; break;
+ }
+ ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
_PUBLIC_ enum ndr_err_code ndr_push_messaging_rec(struct ndr_push *ndr, int ndr_flags, const struct messaging_rec *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->msg_version));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->msg_type));
+ NDR_CHECK(ndr_push_messaging_type(ndr, NDR_SCALARS, r->msg_type));
NDR_CHECK(ndr_push_server_id(ndr, NDR_SCALARS, &r->dest));
NDR_CHECK(ndr_push_server_id(ndr, NDR_SCALARS, &r->src));
NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->buf));
@@ -25,7 +100,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_messaging_rec(struct ndr_pull *ndr, int ndr_
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->msg_version));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->msg_type));
+ NDR_CHECK(ndr_pull_messaging_type(ndr, NDR_SCALARS, &r->msg_type));
NDR_CHECK(ndr_pull_server_id(ndr, NDR_SCALARS, &r->dest));
NDR_CHECK(ndr_pull_server_id(ndr, NDR_SCALARS, &r->src));
NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->buf));
@@ -42,7 +117,7 @@ _PUBLIC_ void ndr_print_messaging_rec(struct ndr_print *ndr, const char *name, c
ndr_print_struct(ndr, name, "messaging_rec");
ndr->depth++;
ndr_print_uint32(ndr, "msg_version", r->msg_version);
- ndr_print_uint32(ndr, "msg_type", r->msg_type);
+ ndr_print_messaging_type(ndr, "msg_type", r->msg_type);
ndr_print_server_id(ndr, "dest", &r->dest);
ndr_print_server_id(ndr, "src", &r->src);
ndr_print_DATA_BLOB(ndr, "buf", r->buf);
diff --git a/source3/librpc/gen_ndr/ndr_messaging.h b/source3/librpc/gen_ndr/ndr_messaging.h
index f47fe547a0..9d0720232d 100644
--- a/source3/librpc/gen_ndr/ndr_messaging.h
+++ b/source3/librpc/gen_ndr/ndr_messaging.h
@@ -7,6 +7,9 @@
#define _HEADER_NDR_messaging
#define NDR_MESSAGING_CALL_COUNT (0)
+enum ndr_err_code ndr_push_messaging_type(struct ndr_push *ndr, int ndr_flags, enum messaging_type r);
+enum ndr_err_code ndr_pull_messaging_type(struct ndr_pull *ndr, int ndr_flags, enum messaging_type *r);
+void ndr_print_messaging_type(struct ndr_print *ndr, const char *name, enum messaging_type r);
enum ndr_err_code ndr_push_messaging_rec(struct ndr_push *ndr, int ndr_flags, const struct messaging_rec *r);
enum ndr_err_code ndr_pull_messaging_rec(struct ndr_pull *ndr, int ndr_flags, struct messaging_rec *r);
void ndr_print_messaging_rec(struct ndr_print *ndr, const char *name, const struct messaging_rec *r);