#!/usr/bin/perl

# $Id: add_rr.pl,v 1.1 1996/01/21 09:42:07 hoagland Exp $

# add_rr.pl, by Jim Hoagland (hoagland@cs) 1/96

# this program adds a new routing rule to the list of routing rules
# then invokes &draw_rr to return the HTML for the page.
#
# Input is CGI, fields on a form,  Output is eventually HTML to STDOUT.

require '/pkg/www/arpa/secret/cgi-bin/gui-helper.pl';
require '/pkg/www/arpa/secret/cgi-bin/draw_rr.pl';

require CGI;

$input= new CGI;

foreach (@ARGV) {  # simulate field input
  $input->param(split('=',$_,2));
}

$state= State->new(&get_statefile);

#-------------

$state->add_routing_rules($input->param('pattern').'  ==>  '.$input->param('route'));
$state->store;

#$goto= $input->param('goto');

&draw_rr($state,$input->param('ws'));

1;
