1. 17 Jan, 2005 2 commits
    • Timothy Stack's avatar
      · 1e18722e
      Timothy Stack authored
      More robot tweaks:
      
      	* event/sched/event-sched.c: Start rmcd, then vmcd.
      
      	* event/sched/rpc.cc: Add camera dimensions to the config file.
      
      	* robots/emc/emcd.c: Add camera dimensions to the config file and
      	destroy vmc's position_list when it disconnects.
      
      	* robots/mtp/mtp.x, robots/mtp/mtp.c: Add dimensions to the camera
      	config and add a command_id field to the update_position packet.
      
      	* robots/primotion/garcia-pilot.cc: Move the decl of the acpGarcia
      	object below daemon(3) since it doesn't seem to like it when the
      	parent process dies and fix the log file creation.
      
      	* robots/primotion/pilotClient.cc: Pass the command_id back in any
      	update_position packets.
      
      	* robots/rmcd/rmcd.c: Use the command-id to distinguish between
      	STOPs for the sake of a GOTO and a wiggle.
      
      	* robots/vmcd/visionTrack.h, robots/vmcd/visionTrack.c: Only
      	coalesce packets from different cameras (duh) and mess with the
      	tolerances a little more.
      
      	* xmlrpc/emulabserver.py.in: Add some rough camera dimensions.
      1e18722e
    • Timothy Stack's avatar
      · bf489797
      Timothy Stack authored
      More robot integration and some event system updates.
      
      	* configure, configure.in: Detect rsync for loghole and add
      	utils/loghole to the list of template files.
      
      	* db/libdb.pm.in, db/xmlconvert.in: Add virt_node_startloc to the
      	list of virtual tables.
      
      	* event/lib/event.h, event/lib/event.c, event/lib/tbevent.py.tail:
      	Add event_stop_main function to break out of the event_main()
      	loop.  Add timeline to the address tuple.
      
      	* event/sched/GNUmakefile.in, event/sched/error-record.h,
      	event/sched/error-record.c, event/sched/event-sched.8,
      	event/sched/event-sched.h, event/sched/event-sched.c,
      	event/sched/group-agent.h, event/sched/group-agent.c,
      	event/sched/listNode.h, event/sched/listNode.c,
      	event/sched/local-agent.h, event/sched/local-agent.c,
      	event/sched/node-agent.h, event/sched/node-agent.cc,
      	event/sched/queue.c, event/sched/rpc.h, event/sched/rpc.cc,
      	event/sched/simulator-agent.h, event/sched/simulator-agent.c,
      	event/sched/timeline-agent.h, event/sched/timeline-agent.c:
      	Updated event scheduler, not completely finished, but well enough
      	along for the robots.
      
      	* lib/libtb/GNUmakefile.in, lib/libtb/popenf.h,
      	lib/libtb/popenf.c, lib/libtb/systemf.h, lib/libtb/systemf.c: Add
      	some handy versions of system/popen that take format arguments.
      
      	* lib/libtb/tbdefs.h, lib/libtb/tbdefs.c: Add some more event and
      	object types.
      
      	* tbsetup/assign_wrapper.in: Add the virt_node_startloc building
      	to desires string for a node.
      
      	* tbsetup/ptopgen.in: Add a node's location to the feature list.
      
      	* tbsetup/tbreport.in: Display the timeline/sequence an event is a
      	part of.
      
      	* tbsetup/ns2ir/GNUmakefile.in: Add timeline, sequence, and
      	topography files.
      
      	* tbsetup/ns2ir/node.tcl: Add initial position for nodes and allow
      	them to be attached to "topographys".
      
      	* tbsetup/ns2ir/parse-ns.in: Make a hwtype_class array with a
      	node_type's class.  Make an 'areas' array that holds the
      	buildings where nodes are located.  Make an 'obstacles' table
      	with any obstacles in the building.
      
      	* tbsetup/ns2ir/parse.tcl.in: Move named-args function from
      	tb_compat.tcl to here.  Add reltime-to-secs function that converts
      	time given in a format like "10h2m1s" to a seconds value, used in
      	"$ns at" so its easier to write time values.  Add "K", "Kb", and
      	"Kbps" as possible units for bandwidth (only the lowercase
      	versions were available before).
      
      	* tbsetup/ns2ir/program.tcl: Add "dir" and "timeout" attributes,
      	although they don't go anywhere at the moment.
      
      	* tbsetup/ns2ir/sequence.tcl, tbsetup/ns2ir/timeline.tcl,
      	tbsetup/ns2ir/topography.tcl: Initial versions.
      
      	* tbsetup/ns2ir/sim.tcl.in: Add support for timelines and
      	sequences.  Add 'node-config' method to change the default
      	configuration for nodes produced by the Simulator object.  Send an
      	initial MODIFY event to any trafgen objects so their configuration
      	gets through, even when there are no start/stop events.  Move
      	event parsing to the 'make_event' method.
      
      	* utils/loghole.1, utils/loghole.in: Loghole utility, used for
      	retrieving logs from experimental nodes and creating archives of
      	the logs.
      
      	* xmlrpc/emulabclient.py.in: Escape any strange characters in the
      	output field.
      
      	* xmlrpc/emulabserver.py.in: Add virt_node_startloc to the list of
      	virtual_tables.  Add emulab.vision_config and
      	emulab.obstacle_config methods for getting information pertaining
      	to the robots.  Change the OSID listing to include more fields.
      	Add a "physical" aspect to experiment.info to get information
      	about the physical nodes.  Add parent field to the events in the
      	array returned by eventlist.  Add sshdescription to get extra
      	information needed to log into a vnode.  Add node.statewait so you
      	can wait for nodes to come up.
      bf489797
  2. 21 Dec, 2004 1 commit
    • Leigh Stoller's avatar
      Rework old XMLRPC code that I stuck into defs.php3 a long time ago, · 98d2ab5f
      Leigh Stoller authored
      but never made use of. Moved to its own file (www/xmlrpc.php3.in)
      and made to be more like the perl library I did a couple of months ago,
      that presents an interface to an sslxmlrpc server, via the sslxmlrpc
      client program operating in "raw" mode (takes raw xml on stdin, and
      returns raw xml on stdout).
      
      Added ELABINELAB code to nodetipacl.php3 so that you can click on
      console icon on an inner emulab web page, and it will ask the outer
      emulab sslxmlrpc server for the stuff it needs, and return that to the
      user.
      98d2ab5f
  3. 20 Dec, 2004 2 commits
  4. 10 Dec, 2004 1 commit
  5. 06 Dec, 2004 1 commit
  6. 29 Nov, 2004 3 commits
  7. 16 Nov, 2004 1 commit
    • Leigh Stoller's avatar
      ElabInElab Addition: New script that uses the frisbee client to · 6777d279
      Leigh Stoller authored
      download images from the outer emulab. This script is invoked from
      frisbeelauncher when ELABINELAB=1 and the filename does not exist
      (thus attempting to get the image file before bailing). The
      frisbeeimage script uses a new method in the RPC server to fire up a
      frisbeed (using frisbeelauncher on the outer Emulab), subject to the
      usual permission checks against creator of the elabinelab experiment
      (I assume that the creator will have access to any outer images that
      are used inside the inner emulab). If outer frisbeelauncher succeeds,
      its return value is the load_address (IP:port), which is used to fire
      up a frisbee client to get the image file and write it out (using
      Mike's new -N option that just dumps the raw data to file). Once the
      image is downloaded, control returns to inner frisbeelauncher and
      proceeds as normal.
      
      I whacked this together pretty quickly. Under heavy usage it might hit
      a race condition or two, but I do not expect that to happen in an
      inner elab for a while.
      6777d279
  8. 15 Nov, 2004 4 commits
    • Timothy Stack's avatar
      · aaff0953
      Timothy Stack authored
      Minor improvement to the node.available() method so you can get the
      number of free nodes of a particular type (e.g. pc850).
      
        * xmlrpc/GNUmakefile.in: Add node_avail symlink.
      
        * xmlrpc/emulabserver.in: Add some optional parameters to
          node.available() so you can specify the class/type of nodes as
          well as project credentials.
      
        * xmlrpc/script_wrapper.py.in: Add node_avail class that calls
          node.available() with the given parameters.
      aaff0953
    • Timothy Stack's avatar
      Catch and ignore OSError thrown by os.listdir() when adding dev trees · 643384a2
      Timothy Stack authored
      to the list of ALLOWED_PATHS.
      643384a2
    • Timothy Stack's avatar
      Add missing "c:" option to getopt. · f486abd8
      Timothy Stack authored
      f486abd8
    • Leigh Stoller's avatar
      ElabinElab changes: · 956b1d0d
      Leigh Stoller authored
      * sslxmlrpc_server.py: A rather gross hack that needs more thought;
        pass the client IP address to the emulabserver class instantiation,
        which is passed along to the new elabinelab module ...
      
      * emulabserver.py: A new class called elabinelab which exports some methods
        that are to be used by an inner elab. At present, the IP address of the
        client is passed along and a bunch of checks are made that restrict the
        client to the inner emulab boss node, with the credentials of the
        creator of the inner emulab. In other words, the ssl certificate of the
        elabinelab creator is placed on the inner boss, and all proxy
        operations are invoked with this certificate (as the creator) and
        only from the inner boss node.
      
        The elabinelab class currently exports two methods; a power method
        to power cycle an inner node; the command is handed of the power
        command, which does the permission checks. Of course, the inner boss
        does its permission checks, but ultimately, the outer boss will
        allow the power cycle only if the client is allowed to power cycle the
        node.
      
        The other method exported is a vlans command to setup and destroy a
        set of vlans for an inner experiment. Permissions checks are modeled as
        above, with everything passed out to new snmpit.proxy script, which
        then invokes plain snmpit.
      956b1d0d
  9. 09 Nov, 2004 1 commit
    • Leigh Stoller's avatar
      Here is a fun little change. Lacking native perl SSL XMLRPC tools, I · a7482569
      Leigh Stoller authored
      put together a little library that provides the illusion of nativeness.
      
      sslxmlrpc_client.py.in: New "rawmode" (-r) option. Instead of the
      usual command line operation, input raw XMLRPC goo and send that over
      to the server. The raw XMLRPC reply goo is spit out on stdout. In
      other words, it is up to the caller to generate the XML stuff, and
      convert back from XML to a reply structure.
      
      libxmlrpc.pm.in: A new perl library that exports one real method
      called, interestingly enough, CallMethod($$$). The first and second
      arguments are the module and method to invoke in the RPC server. The
      third argument is an arbitrary perl data structure to convert into XML
      and pass to the server. For example:
      
      	libxmlrpc::CallMethod("experiment", "state",
      	                      {"proj" => "testbed", "exp" => "myemulab"});
      
      The return value of CallMethod is whatever data structure the server
      returned, or undef if there is an internal error or if the RPC fails
      with a transport error (one of the errors in emulabclient.py).
      
      In case it is not obvious, CallMethod converts the argument to XML
      using the RPC:XML perl module, forks off a child to run
      sslxmlrpc_client.py.in in rawmode, sends it the XML on its stdin,
      reads back the XML for the reply from its stdout, and converts that to
      a perl data structure to return to the caller.
      
      The more interesting use of this new goo is to invoke the new
      "elabinelab" module in the RPC server, which exports some new methods
      to support elabinelab. The idea is that the inner boss will invoke
      routines (like setup/destroy vlans, or power cycle) using the RPC
      server, and the SSL key of the creator of the inner emulab. This will
      be described in more detail when I check in those changes.
      
      There is also a Config() method that is used to set the SSL cert path,
      debugging, verbosity, etc. You can take a look if you are interested.
      
      This can be arbitrarily fancy, but I don't need this for many things.
      a7482569
  10. 08 Nov, 2004 2 commits
  11. 07 Nov, 2004 2 commits
    • Timothy Stack's avatar
      Remove debugging prints. · 3e1986a5
      Timothy Stack authored
      3e1986a5
    • Timothy Stack's avatar
      · f95e336d
      Timothy Stack authored
      Change to the SSL version of the event scheduler.
      
        * db/libdb.py.in, xmlrpc/emulabserver.py.in: Only add the testbed
          library path to sys.path if it is not already there.
      
        * event/sched/GNUmakefile.in: Make the SSL version of the scheduler
          the default instead of the SSH version and statically link the
          executable.
      
        * event/sched/event-sched.c: Pass the default SSL port number (3069)
          to RPC_init.
      
        * event/sched/rpc.cc: Bring the SSL code up to date: read the cert
          from the user's home directory, make the connection persistent,
          and use TBROOT as the request path, so the development version of
          the XML-RPC library is used when appropriate.
      
        * xmlrpc/sslxmlrpc_server.py.in: Updated to let the user select from
          a set of allowed library paths where the 'emulabserver' module
          should be imported from.  Import the 'emulabserver' module after the
          fork so we always get the latest version of the module.  Twiddled
          the necessary bits to turn on persistent connection support.
      f95e336d
  12. 02 Nov, 2004 1 commit
  13. 01 Nov, 2004 1 commit
  14. 29 Oct, 2004 2 commits
    • Timothy Stack's avatar
      Fix a syntax error. · 5050a012
      Timothy Stack authored
      5050a012
    • Timothy Stack's avatar
      · c61858c7
      Timothy Stack authored
      Make the hurting stop.  Make sshxmlrpc auto-detect things, fails over
      properly, and dump useful information when it is unable to deal with
      the peer.
      
        * xmlrpc/sshxmlrpc.py: Major update.  It now tries to autoconfigure
          itself by scanning the path for "ssh" and "plink.exe" (although I
          haven't actually tried it on windows).  Environment variables can
          now be used to turn on debugging and set the command to use for
          doing the ssh.  Before running ssh, it will check for an agent or
          a passphrase-less key and prints a warning if it finds neither.
          The last five lines read from the server, as well as the standard
          error output, are stored so they can be dumped later; helpful for
          figuring out what is actually being run on the other side.  The
          protocol layer between ssh and xml-rpc will now respond to a
          "probe" header so that clients can figure out who they are talking
          too.  The server side will now properly detect a closed connection
          and not write anything, which means no more annoying "Write to
          stdout failed" messages.  You can now pass additional options to
          ssh and set the identity.  The module can be run standalone, with
          the default action being to probe the peer:
      
            $ ./sshxmlrpc.py ssh://boss/xmlrpc
            Probe results for: ssh://boss/xmlrpc
              response time=1.49 s
            Response Headers
              date: Wed Oct 27 16:10:58 2004
      	content-length: 0
      	probe: /usr/testbed/devel/stack/lib/sshxmlrpc.py
      	probe-response: EmulabServer
      
        * xmlrpc/sshxmlrpc_server.py.in: Set the value returned by a "probe"
          to the name of the invoked module.  This way, the other side can
          figure out who they are talking to (e.g. EmulabServer
          vs. experiment vs. fs vs. osid).
      
        * event/sched/event-sched.c, event/sched/rpc.cc, event/sched/rpc.h,
          xmlrpc/script_wrapper.py.in: Multiple paths (e.g. xmlrpc,
          $prefix/sbin/sshxmlrpc_server.py) are now probed before giving up.
          Force the use of the user's default identity and protocol one.
          For event-sched, a single connection is now made at startup and
          dropped before going into the event loop.
      
        * event/sched/GNUmakefile.in: Add a dependency for the install
          target and add -I$(OBJDIR) to the CXXFLAGS.
      
        * install/ports/ulsshxmlrpcpp/Makefile,
          install/ports/ulsshxmlrpcpp/distinfo,
          install/ports/ulsshxmlrpcpp/pkg-descr: Bump version number to 1.1
          and tweak the description.
      
        * config.h.in, configure, configure.in: Add a "#define TBROOT" that
          has the install prefix.
      c61858c7
  15. 15 Oct, 2004 1 commit
  16. 22 Sep, 2004 1 commit
  17. 13 Sep, 2004 1 commit
  18. 10 Sep, 2004 1 commit
  19. 07 Sep, 2004 1 commit
  20. 02 Sep, 2004 1 commit
  21. 01 Sep, 2004 5 commits
    • Leigh Stoller's avatar
      Fix minor typo. · 46f7b3f2
      Leigh Stoller authored
      46f7b3f2
    • Leigh Stoller's avatar
      e2f62c8e
    • Leigh Stoller's avatar
      Reorder syslog ststements slightly. · 37a19abb
      Leigh Stoller authored
      37a19abb
    • Leigh Stoller's avatar
      SSL version of the XMLRPC server. · a9c1045e
      Leigh Stoller authored
      * SSL based server (sslxmlrpc_server.py) that wraps the existing Python
        classes (what we export via the existing ssh XMLRPC server). I also have a
        demo client that is analogous the ssh demo client (sslxmlrpc_client.py).
        This client looks for an ssl cert in the user's .ssl directory, or you can
        specify one on the command line. The demo client is installed on ops, and
        is in the downloads directory with the rest of the xmlrpc stuff we export
        to users. The server runs as root, forking a child for each connection and
        logs connections to /usr/testbed/log/sslxmlrpc.log via syslog.
      
      * New script (mkusercert) generates SSL certs for users. Two modes of
        operation; when called from the account creation path, generates a
        unencrypted private key and certificate for use on Emulab nodes (this is
        analagous to the unencrypted SSH key we generate for users). The other mode
        of operation is used to generate an encrypted private key so that the user
        can drag a certificate to their home/desktop machine.
      
      * New webpage (gensslcert.php3) linked in from the My Emulab page that
        allows users to create a certificate. The user is prompted for a pass
        phrase to encrypt the private key, as well as the user's current Emulab
        login password. mkusercert is called to generate the certificate, and the
        result is stored in the user's ~/.ssl directory, and spit back to the user
        as a text file that can be downloaded and placed in the users homedir on
        their local machine.
      
      * The server needs to associate a certificate with a user so that it can
        flip to that user in the child after it forks. To do that, I have stored
        the uid of the user in the certificate. When a connection comes in, I grab
        the uid out of the certificate and check it against the DB. If there is a
        match (see below) the child does the usual setgid,setgroups,setuid to the
        user, instantiates the Emulab server class, and dispatches the method. At
        the moment, only one request per connection is dispatched. I'm not sure
        how to do a persistant connection on the SSL path, but probably not a big
        deal right now.
      
      * New DB table user_sslcerts that stores the PEM formatted certificates and
        private keys, as well as the serial number of the certificate, for each
        user. I also mark if the private key is encrypted or not, although not
        making any use of this data. At the moment, each user is allowed to get
        one unencrypted cert/key pair and one encrypted cert/key pair. No real
        reason except that I do not want to spend too much time on this until we
        see how/if it gets used. Anyway, the serial number is used as a crude form
        of certificate revocation. When the connection is made, I suck the serial
        number and uid out of the certificate, and look for a match in the table.
        If cert serial number does not match, the connection is rejected. In other
        words, revoking a certificate just means removing its entry from the DB
        for that user. I could also compare the certificate itself, but I am not
        sure what purpose that would serve since that is what the SSL handshake is
        supposed to take of, right?
      
      * Updated the documentation for the XMLRPC server to mention the existence
        of the SSL server and client, with a pointer into the downloads directory
        where users can pick up the client.
      a9c1045e
    • Leigh Stoller's avatar
      Turn off nologins check in state and statewait methods so that we can · 60c2a7ab
      Leigh Stoller authored
      use/test the event system while logins are turned off.
      60c2a7ab
  22. 27 Aug, 2004 1 commit
    • Leigh Stoller's avatar
      Guts of the new ssl server implemented. The server operates more or less · 5a025f36
      Leigh Stoller authored
      like this:
      
      * Listen for connections on port 3069. The server requires client
        authentication, and will fail if a certificate is not provided by
        the client.
      
      * Once the certificate is accepted, the server forks a new child.
      
      * The child looks inside the certificate to get the CN field of the
        Distinguished Name (subject). The CN field must hold the uid of the
        user, which is checked against the DB for a matching user. We get
        the groupslist from the DB, and do a setgid,setgroups,setuid to flip
        to the user in the child.
      
      * A instance of the emulabserver class is created, and the request is
        dispatched.
      
      I added an sslxmlrpc_client.py script that mirrors the ssh version of
      the client script. I could probably roll these into one, but decided
      not to to avoid confusing people who might download it.
      5a025f36
  23. 26 Aug, 2004 1 commit
  24. 25 Aug, 2004 2 commits
  25. 23 Aug, 2004 1 commit