summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-05-11 07:09:05 +0200
committerAndrew Tridgell <tridge@samba.org>2010-08-05 17:31:29 +1000
commita41dffcb6a0a2dcb6bbcf3ecbb4a7a1df47d85df (patch)
treea0fda72beeaa17798f06e51468ea1d930c2129f2 /pidl
parent1a701914fd226f7d3844bd6feadcd58cb7144246 (diff)
downloadsamba-a41dffcb6a0a2dcb6bbcf3ecbb4a7a1df47d85df.tar.gz
samba-a41dffcb6a0a2dcb6bbcf3ecbb4a7a1df47d85df.tar.bz2
samba-a41dffcb6a0a2dcb6bbcf3ecbb4a7a1df47d85df.zip
pidl: added a new type dnsp_name
This is a name type used in DNS where each DNS component maps to a length byte followed by the string We want these to map to a char *, which is why we need to do this in PIDL
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/NDR.pm3
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm6
-rw-r--r--pidl/lib/Parse/Pidl/Typelist.pm1
3 files changed, 9 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm
index a875ec8756..c1ac6001da 100644
--- a/pidl/lib/Parse/Pidl/NDR.pm
+++ b/pidl/lib/Parse/Pidl/NDR.pm
@@ -74,7 +74,8 @@ my $scalar_alignment = {
'COMRESULT' => 4,
'nbt_string' => 4,
'wrepl_nbt_name' => 4,
- 'ipv4address' => 4
+ 'ipv4address' => 4,
+ 'dnsp_name' => 1
};
sub GetElementLevelTable($$)
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 4c5cc1b378..75aa0a8172 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -883,6 +883,11 @@ sub ConvertObjectFromPythonData($$$$$$;$)
return;
}
+ if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "dnsp_name") {
+ $self->pidl("$target = PyString_AsString($cvar);");
+ return;
+ }
+
if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "NTSTATUS") {
$self->pidl("$target = NT_STATUS(PyInt_AsLong($cvar));");
@@ -1018,6 +1023,7 @@ sub ConvertScalarToPython($$$)
# Not yet supported
if ($ctypename eq "string_array") { return "PyCObject_FromTallocPtr($cvar)"; }
if ($ctypename eq "ipv4address") { return "PyString_FromString($cvar)"; }
+ if ($ctypename eq "dnsp_name") { return "PyString_FromString($cvar)"; }
if ($ctypename eq "pointer") {
return "PyCObject_FromTallocPtr($cvar)";
}
diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm
index 1d82dee833..b00f0e4bed 100644
--- a/pidl/lib/Parse/Pidl/Typelist.pm
+++ b/pidl/lib/Parse/Pidl/Typelist.pm
@@ -57,6 +57,7 @@ my %scalars = (
"nbt_string" => "const char *",
"wrepl_nbt_name"=> "struct nbt_name *",
"ipv4address" => "const char *",
+ "dnsp_name" => "const char *",
);
my %aliases = (