3 ## This is a simple script written by Herb Lewis @ SGI <herb@samba.org>
4 ## for reporting which parameters are supported by loadparm.c but
5 ## not by SWAT I just thought it looked fun and might be of interest to others
8 ## Here is a little info on the usage and output format so you don't have
9 ## to dig through the code to understand what is printed.
11 ## Useage: swat.pl [path_to_loadparm.c]
13 ## The output consists of 4 columns of information
14 ## Option Name, Global Page, Share Page, Printer Page
15 ## The section separaters will also be printed (preceded by 16 *) to show
16 ## which options are grouped in the various sections.
18 ## If the option name is preceded by an * it means this is a deprecated option.
19 ## If the option name is preceded by 5 spaces it means this is an alias for the
22 ## Under the Global Page, Share Page, and Printer Page columns there will be
23 ## one of 3 entries, BASIC, ADVANCED, or no. "BASIC" indicates this option will
24 ## show in the Basic View of that page in SWAT. "ADVANCED" indicates this
25 ## option will show in the Advanced View of that page in SWAT. "No" indicates
26 ## that this option is not available on that page in SWAT.
28 ## Under the Global Page column, if an entry begins with an * it indicates that
29 ## this is actually specified in Samba as a "service parameter" not a "global
30 ## parameter" but you can set a default value for this on the Global Page in
40 $filename = "/usr3/samba20/samba/source/param/loadparm.c";
43 open (INFILE
,$filename) || die "unable to open $filename\n";
44 while (not eof(INFILE
))
47 last if ( /^static struct parm_struct parm_table/) ;
49 print "Option Name Global Page Share Page Printer Page\n";
50 print "---------------------------------------------------------------------";
51 while (not eof(INFILE
))
55 @fields = split(/,/,$_);
56 next if not ($fields[0] =~ /^.*{"/);
57 $fields[0] =~ s/.*{"//;
59 if ($fields[3] eq $lastone) {
60 print " $fields[0]\n";
63 $lastone = $fields[3];
64 $fields[2] =~ s/^\s+//;
65 $fields[2] =~ s/\s+$//;
66 $fields[2] =~ s/}.*$//;
67 $fields[6] =~ s/^\s+//;
68 $fields[6] =~ s/\s+$//;
69 $fields[6] =~ s/}.*$//;
70 if ($fields[2] =~ /P_SEPARATOR/) {
71 print "\n****************$fields[0]\n";
75 if ($fields[6] =~ /FLAG_DEPRECATED/) {
76 print "*$fields[0]".' 'x
(31-length($fields[0]));
79 print "$fields[0]".' 'x
(32-length($fields[0]));
82 if (($fields[2] =~ /P_GLOBAL/) || ($fields[6] =~ /FLAG_GLOBAL/)) {
83 if ($fields[6] =~ /FLAG_GLOBAL/) {
89 if ($fields[6] =~ /FLAG_BASIC/) {
99 if ($fields[6] =~ /FLAG_SHARE/) {
100 if ($fields[6] =~ /FLAG_BASIC/) {
110 if ($fields[6] =~ /FLAG_PRINT/) {
111 if ($fields[6] =~ /FLAG_BASIC/) {