diff options
author | Kai Blin <kai@samba.org> | 2010-10-22 09:37:38 +0200 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2010-10-23 10:17:05 +0000 |
commit | 719a6bbfede5b124c96f7c84d27e68ac285b073a (patch) | |
tree | d6a0ce0cdaa7f319d1fa3286ccf1417877f5fcb6 /pidl/lib/Parse | |
parent | 96195b2c0c239781c47f51bbf62156a8804f9525 (diff) | |
download | samba-719a6bbfede5b124c96f7c84d27e68ac285b073a.tar.gz samba-719a6bbfede5b124c96f7c84d27e68ac285b073a.tar.bz2 samba-719a6bbfede5b124c96f7c84d27e68ac285b073a.zip |
ndr dns: Add simple parser
Diffstat (limited to 'pidl/lib/Parse')
-rw-r--r-- | pidl/lib/Parse/Pidl/NDR.pm | 1 | ||||
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Python.pm | 9 | ||||
-rw-r--r-- | pidl/lib/Parse/Pidl/Typelist.pm | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm index b5dd2aaf9c..21b75687a7 100644 --- a/pidl/lib/Parse/Pidl/NDR.pm +++ b/pidl/lib/Parse/Pidl/NDR.pm @@ -72,6 +72,7 @@ my $scalar_alignment = { 'WERROR' => 4, 'NTSTATUS' => 4, 'COMRESULT' => 4, + 'dns_string' => 4, 'nbt_string' => 4, 'wrepl_nbt_name' => 4, 'ipv4address' => 4, diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index cf554f5c0c..f79981e317 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -916,6 +916,11 @@ sub ConvertObjectFromPythonData($$$$$$;$) return; } + if ($actual_ctype->{TYPE} eq "SCALAR" and ($actual_ctype->{NAME} eq "dns_string" or $actual_ctype->{NAME} eq "dns_name")) { + $self->pidl("$target = talloc_strdup($mem_ctx, PyString_AS_STRING($cvar));"); + return; + } + if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "ipv4address") { $self->pidl("$target = PyString_AS_STRING($cvar);"); return; @@ -1094,6 +1099,10 @@ sub ConvertScalarToPython($$$) return "PyString_FromString_check_null($cvar)"; } + if (($ctypename eq "dns_string" or $ctypename eq "dns_name")) { + return "PyString_FromString_check_null($cvar)"; + } + # Not yet supported if ($ctypename eq "string_array") { return "PyCObject_FromTallocPtr($cvar)"; } if ($ctypename eq "ipv4address") { return "PyString_FromString_check_null($cvar)"; } diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm index 00204a3cfc..4733f91565 100644 --- a/pidl/lib/Parse/Pidl/Typelist.pm +++ b/pidl/lib/Parse/Pidl/Typelist.pm @@ -20,7 +20,7 @@ use strict; my %types = (); my @reference_scalars = ( - "string", "string_array", "nbt_string", + "string", "string_array", "nbt_string", "dns_string", "wrepl_nbt_name", "ipv4address", "ipv6address" ); @@ -54,6 +54,7 @@ my %scalars = ( "WERROR" => "WERROR", "NTSTATUS" => "NTSTATUS", "COMRESULT" => "COMRESULT", + "dns_string" => "const char *", "nbt_string" => "const char *", "wrepl_nbt_name"=> "struct nbt_name *", "ipv4address" => "const char *", |