#!/usr/bin/perl # DrakFloppy # $Id$ # # Copyright (C) 2001-2005 Mandriva # Yves Duret # Thierry Vignaud # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA. use strict; use diagnostics; use lib qw(/usr/lib/libDrakX); use standalone; #- warning, standalone must be loaded very first, for 'explanations' use common; use ugtk2 qw(:create :dialogs :helpers :wrappers); use detect_devices; $ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakfloppy-mdk.png"; require_root_capability(); my $window = ugtk2->new('drakfloppy'); unless ($::isEmbedded) { $window->{rwindow}->signal_connect(delete_event => sub { ugtk2->exit(0) }); $window->{rwindow}->set_title(N("drakfloppy")); $window->{rwindow}->set_border_width(5); ### menus definition # the menus are not shown but they provides shiny shortcut like C-q create_factory_menu($window->{rwindow}, ( { path => N("/_File"), item_type => '' }, { path => N("/File/_Quit"), accelerator => N("Q"), callback => sub { ugtk2->exit(0) } }, ) ); } my (@modules, @temp_modules, %buttons, %options, $tree_model, $tree, $list_model, $list); my $conffile = "/etc/sysconfig/drakfloppy"; # we must be robust against config file parsing eval { %options = getVarsFromSh($conffile) }; @modules = split(' ', $options{MODULES}); ######## up part # device part my $device_combo = Gtk2::ComboBox->new_with_strings([ map { "/dev/$_" } detect_devices::floppies_dev() ]); $device_combo->set_active(0); # kernel part my $kernel_combo = Gtk2::ComboBox->new_with_strings([ sort grep { !/^\.\.?$/ } sort(all("/lib/modules")) ], chomp_(`uname -r`)); ########################################################## ### main window $window->{window}->add( gtkpack_(Gtk2::VBox->new, if_($::isEmbedded, 0, Gtk2::Label->new(N("Boot disk creation"))), 0, gtkadd(Gtk2::Frame->new(N("General")), gtkpack__(Gtk2::VBox->new(0, 0), gtkpack__(Gtk2::HBox->new(1, 0), Gtk2::Label->new(N("Device")), $device_combo, gtksignal_connect(Gtk2::Button->new(N("Default")), clicked => sub { $device_combo->entry->set_text("/dev/fd0") }), ), gtkpack__(Gtk2::HBox->new(1, 0), Gtk2::Label->new(N("Kernel version")), $kernel_combo, gtksignal_connect(Gtk2::Button->new(N("Default")), clicked => sub { $kernel_combo->entry->set_text(chomp_(`uname -r`)); }), ), ), ), 1, Gtk2::VBox->new, 0, create_okcancel({ cancel_clicked => sub { ugtk2->exit(0) }, ok_clicked => \&build_it, }, undef, undef, '', [ N("Preferences"), \&pref_dialog, 0 ], ), ), ); $window->{rwindow}->show_all; $window->main; ugtk2->exit(0); my $remove_but; sub pref_dialog() { my $dialog = gtkset_modal(gtkset_size_request(_create_dialog(N("Advanced preferences")), 600, -1), 1); $dialog->set_transient_for($window->{real_window}); # Create root tree: $tree_model = Gtk2::TreeStore->new(("Glib::String") x 2, "Glib::Int"); $tree = Gtk2::TreeView->new_with_model($tree_model); $tree->set_headers_visible(0); $tree->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0)); $tree->signal_connect('row-expanded', \&expand_tree); $tree->get_selection->signal_connect('changed' => \&selected_tree); # Create modules list: $list_model = Gtk2::ListStore->new(("Glib::String") x 3); # relative path, size, (hidden full path) $list = Gtk2::TreeView->new_with_model($list_model); each_index { $list->append_column(my $col = Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i)); $col->set_sort_column_id($::i); $col->set_min_width((200, 50)[$::i]); } (N("Module name"), N("Size")); gtkpack_($dialog->vbox, 0, gtkadd(Gtk2::Frame->new(N("Mkinitrd optional arguments")), gtkpack__(Gtk2::VBox->new(0, 5), $buttons{force} = Gtk2::CheckButton->new(N("force")), $buttons{raid} = Gtk2::CheckButton->new(N("omit raid modules")), $buttons{needed} = Gtk2::CheckButton->new(N("if needed")), $buttons{scsi} = Gtk2::CheckButton->new(N("omit scsi modules")), ), ), 1, gtkadd(Gtk2::Frame->new(N("Add a module")), create_hpaned( gtkset_size_request( create_scrolled_window($tree), 200, $::isEmbedded ? 0 : 175), gtkpack_(Gtk2::VBox->new(0, 0), 1, gtkadd(Gtk2::ScrolledWindow->new, $list ), 0, gtksignal_connect($remove_but = Gtk2::Button->new(N("Remove a module")), clicked => sub { my $iter = ($list->get_selection->get_selected)[1]; return unless $iter; my $removed = $list_model->get($iter, 2); $list_model->remove($iter); @temp_modules = grep { $_ ne $removed } @temp_modules; $remove_but->set_sensitive(scalar @temp_modules); }), ), ), ), ); # restore values: $buttons{$_}->set_active($options{$_}) foreach keys %buttons; fill_tree($kernel_combo->entry->get_text); foreach my $module (@modules) { my $full_path = join('/', "/lib/modules", $kernel_combo->entry->get_text, $module); $full_path =~ s/\.(ko|o)(|.gz)//; my $size = get_file_size(glob_("$full_path.*")); $list_model->append_set(map_index { $::i => $_ } $module, $size, $full_path); } $remove_but->set_sensitive(scalar @modules); @temp_modules = (); gtkadd($dialog->action_area, create_okcancel({ cancel_clicked => sub { $dialog->destroy }, ok_clicked => sub { # save values: $options{$_} = $buttons{$_}->get_active foreach keys %buttons; my $val; @modules = (); $list_model->foreach(sub { my ($model, $_path, $iter) = @_; push @modules, $model->get($iter, 0); return 0; }, $val); $dialog->destroy; }, }), ); $dialog->show_all; $dialog->run; } #------------------------------------------------------------- # tree functions #------------------------------------------------------------- ### Subroutines sub fill_tree { my ($root_dir) = @_; $root_dir = "/lib/modules/" . $root_dir; # Create root tree item widget my $parent_iter = $tree_model->append_set(undef, [ 0 => $root_dir, 1 => $root_dir, 2 => has_sub_trees($root_dir) ]); # Create the subtree expand_tree($tree, $parent_iter, $tree_model->get_path($parent_iter)) if has_sub_trees($root_dir); } # Called whenever an item is clicked on the tree widget. sub selected_tree { my ($select) = @_; my ($model, $iter) = $select->get_selected; $remove_but->set_sensitive($model && $iter); return unless $model; # no real selection my $file = $model->get($iter, 1); return if -d $file; my $size = get_file_size($file); return if member($file, @temp_modules); push @temp_modules, $file; $list_model->append_set([ 0 => stripit($file), 1 => $size, 2 => $file ]); } # Callback for expanding a tree - find subdirectories, files and add them to tree sub expand_tree { my ($tree, $parent_iter, $path) = @_; return if !$tree || !$parent_iter; my $dir = $tree_model->get($parent_iter, 1); #- if we're hinted to be expandable if ($tree_model->get($parent_iter, 2)) { #- hackish: if first child has '' as name, then we need to expand on the fly if ($tree_model->iter_has_child($parent_iter)) { my $child = $tree_model->iter_children($parent_iter); # BUG: ->iter_children return invalid iterators !!! thus the dummy empty line $tree_model->remove($child); } # do not refill the parent anymore $tree_model->set($parent_iter, 2 => 0); foreach my $dir_entry (sort(all($dir))) { my $entry_path = $dir . "/" . $dir_entry; if (-d $entry_path || $dir_entry =~ /\.(k|)o(\.gz)?$/) { $entry_path =~ s|//|/|g; my $iter = $tree_model->append_set($parent_iter, [ 0 => $dir_entry, 1 => $entry_path, 2 => has_sub_trees($entry_path) ]); #- hackery for partial displaying of trees, used in rpmdrake: #- if leaf is void, we may create the parent and one child (to have the [+] in front of the parent in the ctree) #- though we use '' as the label of the child; then rpmdrake will connect on tree_expand, and whenever #- the first child has '' as the label, it will remove the child and add all the "right" children $tree_model->append_set($iter, [ 0 => '' ]) if has_sub_trees($entry_path); } } } $tree->expand_row($path, 0); } #------------------------------------------------------------- # the function #------------------------------------------------------------- sub build_it() { my $initrd_args = join(' ', if_($options{force}, "-f"), if_($options{needed}, "--ifneeded"), if_($options{scsi}, "--omit-scsi-modules"), if_($options{raid}, "--omit-raid-modules"), if_(@modules, map { my $i = $_; $i =~ s!.*/!!; "--with=$i" } @modules), ); $initrd_args = qq(--mkinitrdargs "$initrd_args") if $initrd_args; my $co = join(' ', "/sbin/mkbootdisk --noprompt --verbose --device", $device_combo->entry->get_text, $initrd_args); $options{MODULES} = join(' ', @modules); setVarsInSh($conffile, \%options); $co .= " " . $kernel_combo->entry->get_text; $co .= " 2>&1 |"; $::testing or warn_dialog(N("Warning"), N("Be sure a media is present for the device %s", $device_combo->entry->get_text)) or return; # we test if the media is present test: my $a = "dd count=1 if=/dev/null of=" . $device_combo->entry->get_text . " 2>&1"; my $b = `$a`; if (!$::testing && $b =~ /dd/) { err_dialog(N("Error"), N("There is no medium or it is write-protected for device %s.\nPlease insert one.", $device_combo->entry->get_text), { cancel => 1 }) ? goto test : return 0; } open(my $STATUS, $co) or do { err_dialog(N("Error"), N("Unable to fork: %s", $!)); return }; my $log = join('', <$STATUS>); if (close $STATUS) { info_dialog(N("Floppy creation completed"), N("The creation of the boot floppy has been successfully completed \n")); ugtk2->exit; } else { err_dialog(N("Error"), #-PO: Do not alter the and tags N("Unable to properly close mkbootdisk:\n\n%s", $log), { use_markup => 1 }); } return 0; } sub get_file_size { my ($file) = @_; (lstat($file))[7]; } #### # This is put at the end of the file because any translatable string # appearing after this will not be found by xgettext, and so wont end in # the pot file... #### # Test whether a directory has subdirectories sub has_sub_trees { my ($dir) = @_; foreach my $file (glob_("$dir/*")) { return 1 if -d $file || $file =~ /\.(k|)o(\.gz)?$/; } return 0; } sub stripit { my ($file) = @_; $file =~ s|/lib/modules/.*?/||g; $file; } 1' href='#n271'>271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740
#define _(x) x

/* @(#)rpcinfo.c        2.2 88/08/11 4.0 RPCSRC */
#if !defined(lint) && defined (SCCSID)
static char sccsid[] = "@(#)rpcinfo.c 1.22 87/08/12 SMI";
#endif

/*
 * Copyright (C) 1986, Sun Microsystems, Inc.
 */

/*
 * rpcinfo: ping a particular rpc program
 *     or dump the portmapper
 */

/*
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify Sun RPC without charge, but are not authorized
 * to license or distribute it to anyone else except as part of a product or
 * program developed by the user.
 *
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 *
 * Sun RPC is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 *
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
 * OR ANY PART THEREOF.
 *
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even if
 * Sun has been advised of the possibility of such damages.
 *
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */

#include <getopt.h>
#include <string.h>
#include <unistd.h>
#include <rpc/rpc.h>
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
#include <signal.h>
#include <ctype.h>
#include <locale.h>
#include <libintl.h>

#define MAXHOSTLEN 256

#define	MIN_VERS	((u_long) 0)
#define	MAX_VERS	((u_long) 4294967295UL)

static void udpping (u_short portflag, int argc, char **argv);
static void tcpping (u_short portflag, int argc, char **argv);
static int pstatus (CLIENT *client, u_long prognum, u_long vers);
static void pmapdump (int argc, char **argv);
static bool_t reply_proc (void *res, struct sockaddr_in *who);
static void brdcst (int argc, char **argv) __attribute__ ((noreturn));
static void deletereg (int argc, char **argv);
static void usage (void);
static u_long getprognum (char *arg);
static u_long getvers (char *arg);
static void get_inet_address (struct sockaddr_in *addr, char *host);

/*
 * Functions to be performed.
 */
#define	NONE		0	/* no function */
#define	PMAPDUMP	1	/* dump portmapper registrations */
#define	TCPPING		2	/* ping TCP service */
#define	UDPPING		3	/* ping UDP service */
#define	BRDCST		4	/* ping broadcast UDP service */
#define DELETES		5	/* delete registration for the service */

int
main (int argc, char **argv)
{
  register int c;
  int errflg;
  int function;
  u_short portnum;

  setlocale (LC_ALL, "");

  function = NONE;
  portnum = 0;
  errflg = 0;
  while ((c = getopt (argc, argv, "ptubdn:")) != -1)
    {
      switch (c)
	{

	case 'p':
	  if (function != NONE)
	    errflg = 1;
	  else
	    function = PMAPDUMP;
	  break;

	case 't':
	  if (function != NONE)
	    errflg = 1;
	  else
	    function = TCPPING;
	  break;

	case 'u':
	  if (function != NONE)
	    errflg = 1;
	  else
	    function = UDPPING;
	  break;

	case 'b':
	  if (function != NONE)
	    errflg = 1;
	  else
	    function = BRDCST;
	  break;

	case 'n':
	  portnum = (u_short) atoi (optarg);	/* hope we don't get bogus # */
	  break;

	case 'd':
	  if (function != NONE)
	    errflg = 1;
	  else
	    function = DELETES;
	  break;

	case '?':
	  errflg = 1;
	}
    }

  if (errflg || function == NONE)
    {
      usage ();
      return 1;
    }

  switch (function)
    {

    case PMAPDUMP:
      if (portnum != 0)
	{
	  usage ();
	  return 1;
	}
      pmapdump (argc - optind, argv + optind);
      break;

    case UDPPING:
      udpping (portnum, argc - optind, argv + optind);
      break;

    case TCPPING:
      tcpping (portnum, argc - optind, argv + optind);
      break;

    case BRDCST:
      if (portnum != 0)
	{
	  usage ();
	  return 1;
	}
      brdcst (argc - optind, argv + optind);
      break;

    case DELETES:
      deletereg (argc - optind, argv + optind);
      break;
    }

  return 0;
}

static void
udpping (portnum, argc, argv)
     u_short portnum;
     int argc;
     char **argv;
{
  struct timeval to;
  struct sockaddr_in addr;
  enum clnt_stat rpc_stat;
  CLIENT *client;
  u_long prognum, vers, minvers, maxvers;
  int sock = RPC_ANYSOCK;
  struct rpc_err rpcerr;
  int failure;

  if (argc < 2 || argc > 3)
    {
      usage ();
      exit (1);
    }
  prognum = getprognum (argv[1]);
  get_inet_address (&addr, argv[0]);
  /* Open the socket here so it will survive calls to clnt_destroy */
  sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
  if (sock < 0)
    {
      perror ("rpcinfo: socket");
      exit (1);
    }
  failure = 0;
  if (argc == 2)
    {
      /*
       * A call to version 0 should fail with a program/version
       * mismatch, and give us the range of versions supported.
       */
      addr.sin_port = htons (portnum);
      to.tv_sec = 5;
      to.tv_usec = 0;
      if ((client = clntudp_create (&addr, prognum, (u_long) 0,
				    to, &sock)) == NULL)
	{
	  clnt_pcreateerror ("rpcinfo");
	  printf (_("program %lu is not available\n"), prognum);
	  exit (1);
	}
      to.tv_sec = 10;
      to.tv_usec = 0;
      rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void,
			    (char *) NULL, (xdrproc_t) xdr_void,
			    (char *) NULL, to);
      if (rpc_stat == RPC_PROGVERSMISMATCH)
	{
	  clnt_geterr (client, &rpcerr);
	  minvers = rpcerr.re_vers.low;
	  maxvers = rpcerr.re_vers.high;
	}
      else if (rpc_stat == RPC_SUCCESS)
	{
	  /*
	   * Oh dear, it DOES support version 0.
	   * Let's try version MAX_VERS.
	   */
	  addr.sin_port = htons (portnum);
	  to.tv_sec = 5;
	  to.tv_usec = 0;
	  if ((client = clntudp_create (&addr, prognum, MAX_VERS,
					to, &sock)) == NULL)
	    {
	      clnt_pcreateerror ("rpcinfo");
	      printf (_("program %lu version %lu is not available\n"),
		      prognum, MAX_VERS);
	      exit (1);
	    }
	  to.tv_sec = 10;
	  to.tv_usec = 0;
	  rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void,
				NULL, (xdrproc_t) xdr_void, NULL, to);
	  if (rpc_stat == RPC_PROGVERSMISMATCH)
	    {
	      clnt_geterr (client, &rpcerr);
	      minvers = rpcerr.re_vers.low;
	      maxvers = rpcerr.re_vers.high;
	    }
	  else if (rpc_stat == RPC_SUCCESS)
	    {
	      /*
	       * It also supports version MAX_VERS.
	       * Looks like we have a wise guy.
	       * OK, we give them information on all
	       * 4 billion versions they support...
	       */
	      minvers = 0;
	      maxvers = MAX_VERS;
	    }
	  else
	    {
	      (void) pstatus (client, prognum, MAX_VERS);
	      exit (1);
	    }
	}
      else
	{
	  (void) pstatus (client, prognum, (u_long) 0);
	  exit (1);
	}
      clnt_destroy (client);
      for (vers = minvers; vers <= maxvers; vers++)
	{
	  addr.sin_port = htons (portnum);
	  to.tv_sec = 5;
	  to.tv_usec = 0;
	  if ((client = clntudp_create (&addr, prognum, vers,
					to, &sock)) == NULL)
	    {
	      clnt_pcreateerror ("rpcinfo");
	      printf (_("program %lu version %lu is not available\n"),
		      prognum, vers);
	      exit (1);
	    }
	  to.tv_sec = 10;
	  to.tv_usec = 0;
	  rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void,
				NULL, (xdrproc_t) xdr_void, NULL, to);
	  if (pstatus (client, prognum, vers) < 0)
	    failure = 1;
	  clnt_destroy (client);
	}
    }
  else
    {
      vers = getvers (argv[2]);
      addr.sin_port = htons (portnum);
      to.tv_sec = 5;
      to.tv_usec = 0;
      if ((client = clntudp_create (&addr, prognum, vers,
				    to, &sock)) == NULL)
	{
	  clnt_pcreateerror ("rpcinfo");
	  printf (_("program %lu version %lu is not available\n"),
		  prognum, vers);
	  exit (1);
	}
      to.tv_sec = 10;
      to.tv_usec = 0;
      rpc_stat = clnt_call (client, 0, (xdrproc_t) xdr_void, NULL,
			    (xdrproc_t) xdr_void, NULL, to);
      if (pstatus (client, prognum, vers) < 0)
	failure = 1;
    }
  (void) close (sock);		/* Close it up again */
  if (failure)
    exit (1);
}

static void
tcpping (portnum, argc, argv)
     u_short portnum;
     int argc;
     char **argv;
{
  struct timeval to;
  struct sockaddr_in addr;
  enum clnt_stat rpc_stat;
  CLIENT *client;
  u_long prognum, vers, minvers, maxvers;
  int sock = RPC_ANYSOCK;
  struct rpc_err rpcerr;
  int failure;

  if (argc < 2 || argc > 3)
    {
      usage ();
      exit (1);
    }
  prognum = getprognum (argv[1]);
  get_inet_address (&addr, argv[0]);
  failure = 0;
  if (argc == 2)
    {
      /*
       * A call to version 0 should fail with a program/version
       * mismatch, and give us the range of versions supported.
       */
      addr.sin_port = htons (portnum);
      if ((client = clnttcp_create (&addr, prognum, MIN_VERS,
				    &sock, 0, 0)) == NULL)
	{
	  clnt_pcreateerror ("rpcinfo");
	  printf (_("program %lu is not available\n"), prognum);
	  exit (1);
	}
      to.tv_sec = 10;
      to.tv_usec = 0;
      rpc_stat = clnt_call (client, NULLPROC, (xdrproc_t) xdr_void, NULL,
			    (xdrproc_t) xdr_void, NULL, to);