Remove evil hack which breaks Python bindings.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 26 May 2008 11:31:57 +0000 (13:31 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 26 May 2008 11:31:57 +0000 (13:31 +0200)
source/lib/messaging/tests/bindings.py
source/libcli/nbt/nbtname.c
source/librpc/idl/nbt.idl

index 3d58843799f3c7babf6c88255260b7728f51d68d..c89538ddfacd2c48d164fc3de9233f271be95125 100644 (file)
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-from samba.irpc import Messaging
+from samba.messaging import Messaging
 from unittest import TestCase
 
 class MessagingTests(TestCase):
index 0d9073ccbb31adb72bf3690c356c515e81d1ecbb..97ae2e9d724974b8c9eee3050a9c64954adec135 100644 (file)
@@ -626,3 +626,24 @@ _PUBLIC_ void ndr_print_wrepl_nbt_name(struct ndr_print *ndr, const char *name,
        ndr_print_string(ndr, name, s);
        talloc_free(s);
 }
+
+_PUBLIC_ enum ndr_err_code ndr_push_nbt_res_rec(struct ndr_push *ndr, int ndr_flags, const struct nbt_res_rec *r)
+{
+       {
+               uint32_t _flags_save_STRUCT = ndr->flags;
+               ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
+               if (ndr_flags & NDR_SCALARS) {
+                       NDR_CHECK(ndr_push_align(ndr, 4));
+                       NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->name));
+                       NDR_CHECK(ndr_push_nbt_qtype(ndr, NDR_SCALARS, r->rr_type));
+                       NDR_CHECK(ndr_push_nbt_qclass(ndr, NDR_SCALARS, r->rr_class));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ttl));
+                       NDR_CHECK(ndr_push_set_switch_value(ndr, &r->rdata, ((((r->rr_type) == NBT_QTYPE_NETBIOS) && ((r->rdata).data.length == 2))?0:r->rr_type)));
+                       NDR_CHECK(ndr_push_nbt_rdata(ndr, NDR_SCALARS, &r->rdata));
+               }
+               if (ndr_flags & NDR_BUFFERS) {
+               }
+               ndr->flags = _flags_save_STRUCT;
+       }
+       return NDR_ERR_SUCCESS;
+}
index 783f04eb4214d2cdf129718585a4bf1b3aa68b07..a6d0245455b6a070724f392f7d9052abb6dd7170 100644 (file)
@@ -73,11 +73,11 @@ interface nbt
                nbt_name_type type;
        } nbt_name;
 
-       typedef [enum16bit] enum {
+       typedef [public,enum16bit] enum {
                NBT_QCLASS_IP = 0x01
        } nbt_qclass;
 
-       typedef [enum16bit] enum {
+       typedef [public,enum16bit] enum {
                NBT_QTYPE_ADDRESS     = 0x0001,
                NBT_QTYPE_NAMESERVICE = 0x0002,
                NBT_QTYPE_NULL        = 0x000A,
@@ -160,30 +160,24 @@ interface nbt
                uint8  data[length];
        } nbt_rdata_data;
 
-       typedef [nodiscriminant] union {
+       typedef [nodiscriminant,public] union {
                [case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios;
                [case(NBT_QTYPE_STATUS)]  nbt_rdata_status status;
                [default]                 nbt_rdata_data   data;
        } nbt_rdata;
 
 /*
- * this macro works arround the problem
+ * this macro works around the problem
  * that we need to use nbt_rdata_data
  * together with NBT_QTYPE_NETBIOS
  * for WACK replies
  */
-#define NBT_RES_REC_LEVEL(rr_type, rdata) (\
-       (((rr_type) == NBT_QTYPE_NETBIOS) && \
-       talloc_check_name(ndr, "struct ndr_push") && \
-       ((rdata).data.length == 2)) \
-       ? 0 : rr_type)
-
-       typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct {
+       typedef [flag(LIBNDR_PRINT_ARRAY_HEX),nopush] struct {
                nbt_name   name;
                nbt_qtype  rr_type;
                nbt_qclass rr_class;
                uint32     ttl;
-               [switch_is(NBT_RES_REC_LEVEL(rr_type, rdata))] nbt_rdata rdata;
+               [switch_is(rr_type)] nbt_rdata rdata;
        } nbt_res_rec;
 
        typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {