librpc/ndr: add ndr_table_by_syntax()
authorStefan Metzmacher <metze@samba.org>
Fri, 24 Jan 2014 09:28:05 +0000 (10:28 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 11 Feb 2014 15:20:28 +0000 (16:20 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
librpc/ndr/ndr_table.c
librpc/ndr/ndr_table.h

index f73b9fcaf54c7b5387c039a8ddaca8525baf9688..3dc158fa7ead5ecf0e8f0755197d27db9dea1778 100644 (file)
@@ -97,6 +97,20 @@ const struct ndr_interface_table *ndr_table_by_name(const char *name)
        return NULL;
 }
 
+/*
+  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
 */
index 207618f644e8c009efc61ee158d114cfc8b6a46a..1f6858a5f04c8434c9127379e598da4f5de3f685 100644 (file)
@@ -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);