summaryrefslogtreecommitdiffstats
path: root/librpc/ndr
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-24 10:28:05 +0100
committerGünther Deschner <gd@samba.org>2014-02-11 16:20:28 +0100
commitd6c91502c061fef9c42eaf99418ec427e96b1c20 (patch)
treef689e21f8865e62f6aadc290fa3b780f5995265d /librpc/ndr
parent8e4a78655a79d11055ba801046b715f0b0daad0b (diff)
downloadsamba-d6c91502c061fef9c42eaf99418ec427e96b1c20.tar.gz
samba-d6c91502c061fef9c42eaf99418ec427e96b1c20.tar.xz
samba-d6c91502c061fef9c42eaf99418ec427e96b1c20.zip
librpc/ndr: add ndr_table_by_syntax()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/ndr_table.c14
-rw-r--r--librpc/ndr/ndr_table.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/librpc/ndr/ndr_table.c b/librpc/ndr/ndr_table.c
index f73b9fcaf54..3dc158fa7ea 100644
--- a/librpc/ndr/ndr_table.c
+++ b/librpc/ndr/ndr_table.c
@@ -98,6 +98,20 @@ const struct ndr_interface_table *ndr_table_by_name(const char *name)
}
/*
+ find a dcerpc interface by syntax
+*/
+const struct ndr_interface_table *ndr_table_by_syntax(const struct ndr_syntax_id *syntax)
+{
+ const struct ndr_interface_list *l;
+ for (l=ndr_table_list();l;l=l->next) {
+ if (ndr_syntax_id_equal(&l->table->syntax_id, syntax)) {
+ return l->table;
+ }
+ }
+ return NULL;
+}
+
+/*
find a dcerpc interface by uuid
*/
const struct ndr_interface_table *ndr_table_by_uuid(const struct GUID *uuid)
diff --git a/librpc/ndr/ndr_table.h b/librpc/ndr/ndr_table.h
index 207618f644e..1f6858a5f04 100644
--- a/librpc/ndr/ndr_table.h
+++ b/librpc/ndr/ndr_table.h
@@ -27,6 +27,7 @@ NTSTATUS ndr_table_register(const struct ndr_interface_table *table);
const char *ndr_interface_name(const struct GUID *uuid, uint32_t if_version);
int ndr_interface_num_calls(const struct GUID *uuid, uint32_t if_version);
const struct ndr_interface_table *ndr_table_by_name(const char *name);
+const struct ndr_interface_table *ndr_table_by_syntax(const struct ndr_syntax_id *syntax);
const struct ndr_interface_table *ndr_table_by_uuid(const struct GUID *uuid);
const struct ndr_interface_list *ndr_table_list(void);
NTSTATUS ndr_table_init(void);