⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pidl

📁 samba最新软件
💻
📖 第 1 页 / 共 2 页
字号:
#!/usr/bin/perl -w#################################################### package to parse IDL files and generate code for# rpc functions in Samba# Copyright tridge@samba.org 2000-2003# Copyright jelmer@samba.org 2005-2007# released under the GNU GPL=pod=head1 NAMEpidl - An IDL compiler written in Perl=head1 SYNOPSISpidl --helppidl [--outputdir[=OUTNAME]] [--includedir DIR...] [--parse-idl-tree] [--dump-idl-tree] [--dump-ndr-tree] [--header[=OUTPUT]] [--ejs[=OUTPUT]] [--python[=OUTPUT]] [--swig[=OUTPUT]] [--ndr-parser[=OUTPUT]] [--client] [--server] [--warn-compat] [--quiet] [--verbose] [--template] [--ws-parser[=OUTPUT]] [--diff] [--dump-idl] [--tdr-parser[=OUTPUT]] [--samba3-ndr-client[=OUTPUT]] [--samba3-ndr-server[=OUTPUT]] [--typelib=[OUTPUT]] [<idlfile>.idl]...=head1 DESCRIPTIONpidl is an IDL compiler written in Perl that aims to be somewhat compatible with the midl compiler. IDL is short for "Interface Definition Language".pidl can generate stubs for DCE/RPC server code, DCE/RPC client code and Wireshark dissectors for DCE/RPC traffic.IDL compilers like pidl take a description of an interface as their input and use it to generate C (though support for other languages may be added later) code that can use these interfaces, pretty print data sent using these interfaces, or even generate Wireshark dissectors that can parse data sent over the wire by these interfaces. pidl takes IDL files in the same format as is used by midl, converts it to a .pidl file (which contains pidl's internal representation of the interface) and can then generate whatever output you need..pidl files should be used for debugging purposes only. Write your interface definitions in .idl format.The goal of pidl is to implement a IDL compiler that can be used while developing the RPC subsystem in Samba (for both marshalling/unmarshalling and debugging purposes).=head1 OPTIONS=over 4=item I<--help>Show list of available options.=item I<--version>Show pidl version		=item I<--outputdir OUTNAME>Write output files to the specified directory.  Defaults to the current directory.=item I<--includedir DIR>Add DIR to the search path used by the preprocessor. This option can be specified multiple times.		=item I<--parse-idl-tree>Read internal tree structure from input files rather than assuming they contain IDL.=item I<--dump-idl>Generate a new IDL file. File will be named OUTNAME.idl.=item I<--header>Generate a C header file for the specified interface. Filename defaults to OUTNAME.h.=item I<--ndr-parser>Generate a C file and C header containing NDR parsers. The filename for the parser defaults to ndr_OUTNAME.c. The header filename will be the parser filename with the extension changed from .c to .h.=item I<--tdr-parser>Generate a C file and C header containing TDR parsers. The filename for the parser defaults to tdr_OUTNAME.c. The header filename will be the parser filename with the extension changed from .c to .h.=item I<--typelib>Write type information to the specified file.=item I<--server>Generate boilerplate for the RPC server that implements the interface. Filename defaults to ndr_OUTNAME_s.c.=item I<--template>Generate stubs for a RPC server that implements the interface. Output will be written to stdout.=item I<--ws-parser>Generate an Wireshark dissector (in C) and header file. The dissector filenamedefaults to packet-dcerpc-OUTNAME.c while the header filename defaults to packet-dcerpc-OUTNAME.h.	Pidl will read additional data from an Wireshark conformance file if present. Such a file should have the same location as the IDL file but with the extension I<cnf> rather than I<idl>. See L<Parse::Pidl::Wireshark::Conformance>for details on the format of this file.=item I<--diff>Parse an IDL file,  generate a new IDL file based on the internal data structures and see if there are any differences with the original IDL file. Useful for debugging pidl.=item I<--dump-idl-tree>Tell pidl to dump the internal tree representation of an IDL file the to disk. Useful for debugging pidl.=item I<--dump-ndr-tree>Tell pidl to dump the internal NDR information tree it generated from the IDL file to disk.  Useful for debugging pidl.=item I<--samba3-ndr-client>Generate client calls for Samba3, to be placed in rpc_client/. Instead of calling out to the code in Samba3's rpc_parse/, this will call out to Samba4's NDR code instead.=item I<--samba3-ndr-server>Generate server calls for Samba3, to be placed in rpc_server/. Instead of calling out to the code in Samba3's rpc_parse/, this will call out to Samba4's NDR code instead.=back=head1 IDL SYNTAXIDL files are always preprocessed using the C preprocessor.Pretty much everything in an interface (the interface itself, functions, parameters) can have attributes (or properties whatever name you give them). Attributes always prepend the element they apply to and are surrounded by square brackets ([]). Multiple attributes are separated by comma's; arguments to attributes are specified between parentheses. See the section COMPATIBILITY for the list of attributes that pidl supports.C-style comments can be used.	=head2 CONFORMANT ARRAYSA conformant array is one with that ends in [*] or []. The strangethings about conformant arrays are that they can only appear as the last element of a structure (unless there is a pointer to the conformant array, of course) and the array size appears before the structure itself on the wire. So, in this example:	typedef struct {		long abc;		long count;     		long foo;		[size_is(count)] long s[*];	} Struct1;it appears like this:	[size_is] [abc] [count] [foo] [s...]the first [size_is] field is the allocation size of the array, andoccurs before the array elements and even before the structurealignment.Note that size_is() can refer to a constant, but that doesn't changethe wire representation. It does not make the array a fixed array.midl.exe would write the above array as the following C header:   typedef struct {		long abc;		long count;     		long foo;		long s[1];	} Struct1;pidl takes a different approach, and writes it like this:    typedef struct {		long abc;		long count;     		long foo;		long *s;	} Struct1;=head2 VARYING ARRAYSA varying array looks like this:	typedef struct {		long abc;		long count;     		long foo;		[size_is(count)] long *s;	} Struct1;This will look like this on the wire:	[abc] [count] [foo] [PTR_s]    [count] [s...]=head2 FIXED ARRAYSA fixed array looks like this:    typedef struct {	    long s[10];    } Struct1;The NDR representation looks just like 10 separate longdeclarations. The array size is not encoded on the wire.pidl also supports "inline" arrays, which are not part of the IDL/NDRstandard. These are declared like this:    typedef struct {	    uint32 foo;	    uint32 count;	    uint32 bar;	    long s[count];    } Struct1;This appears like this:	[foo] [count] [bar] [s...]Fixed arrays are an extension added to support some of the strangeembedded structures in security descriptors and spoolss. This section is by no means complete. See the OpenGroup and MSDN 	documentation for additional information.=head1 COMPATIBILITY WITH MIDL=head2 Missing features in pidlThe following MIDL features are not (yet) implemented in pidl or are implemented with an incompatible interface:=over=item *Asynchronous communication=item * Typelibs (.tlb files)=item *Datagram support (ncadg_*)=back=head2 Supported attributes and statementsin, out, ref, length_is, switch_is, size_is, uuid, case, default, string, unique, ptr, pointer_default, v1_enum, object, helpstring, range, local, call_as, endpoint, switch_type, progid, coclass, iid_is, represent_as, transmit_as, import, include, cpp_quote.=head2 PIDL Specific properties=over 4=item publicThe [public] property on a structure or union is a pidl extension thatforces the generated pull/push functions to be non-static. This allowsyou to declare types that can be used between modules. If you don'tspecify [public] then pull/push functions for other than top-levelfunctions are declared static.				=item noprintThe [noprint] property is a pidl extension that allows you to specifythat pidl should not generate a ndr_print_*() function for thatstructure or union. This is used when you wish to define your ownprint function that prints a structure in a nicer manner. A goodexample is the use of [noprint] on dom_sid, which allows thepretty-printing of SIDs.=item valueThe [value(expression)] property is a pidl extension that allows youto specify the value of a field when it is put on the wire. Thisallows fields that always have a well-known value to be automaticallyfilled in, thus making the API more programmer friendly. Theexpression can be any C expression.=item relativeThe [relative] property can be supplied on a pointer. When it is usedit declares the pointer as a spoolss style "relative" pointer, whichmeans it appears on the wire as an offset within the currentencapsulating structure. This is not part of normal IDL/NDR, but it isa very useful extension as it avoids the manual encoding of manycomplex structures.=item subcontext(length)Specifies that a size of I<length>bytes should be read, followed by a blob of that size, which will be parsed as NDR.subcontext() is deprecated now, and should not be used in new code. Instead, use represent_as() or transmit_as().=item flagSpecify boolean options, mostly used for low-level NDR options. Several options can be specified using the | character.Note that flags are inherited by substructures!=item nodiscriminantThe [nodiscriminant] property on a union means that the usual uint16discriminent field at the start of the union on the wire isomitted. This is not normally allowed in IDL/NDR, but is used for somespoolss structures.=item charset(name)Specify that the array or string uses the specified charset. If this attribute is specified, pidl will take care of converting the character data from this format to the host format. Commonly used values are UCS2, DOS and UTF8.=back=head2 Unsupported MIDL properties or statementsaggregatable, appobject, async_uuid, bindable, control, defaultbind, defaultcollelem, defaultvalue, defaultvtable, dispinterface, displaybind, dual, entry, first_is, helpcontext, helpfile, helpstringcontext, helpstringdll, hidden, idl_module, idl_quote, id, immediatebind, importlib, includelib, last_is, lcid, licensed, max_is, module, ms_union, no_injected_text, nonbrowsable, noncreatable, nonextensible, odl, oleautomation, optional, pragma, propget, propputref, propput, readonly, requestedit, restricted, retval, source, uidefault, usesgetlasterror, vararg, vi_progid, wire_marshal. =head1 EXAMPLES	# Generating an Wireshark parser	$ ./pidl --ws-parser -- atsvc.idl		# Generating a TDR parser and header	$ ./pidl --tdr-parser --header -- regf.idl	# Generating a Samba3 client and server	$ ./pidl --samba3-ndr-client --samba3-ndr-server -- dfs.idl	# Generating a Samba4 NDR parser, client and server	$ ./pidl --ndr-parser --ndr-client --ndr-server -- samr.idl=head1 SEE ALSOL<http://msdn.microsoft.com/library/en-us/rpc/rpc/field_attributes.asp>,L<http://wiki.wireshark.org/DCE/RPC>, L<http://www.samba.org/>,L<yapp(1)>=head1 LICENSEpidl is licensed under the GNU General Public License L<http://www.gnu.org/licenses/gpl.html>.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -