1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/mtransport/third_party/nrappkit/README Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,133 @@ 1.4 +$Id: README,v 1.3 2007/11/21 00:09:10 adamcain Exp $ 1.5 + 1.6 +nrappkit 1.0b2 1.7 +Copyright (C) 2006 Network Resonance, Inc. 1.8 + 1.9 + 1.10 +nrappkit is a toolkit for building standalone applications and 1.11 +appliances. It provides: 1.12 + 1.13 +- registry-based configuration (with change callbacks) 1.14 +- extensible command and configuration shell 1.15 +- extensible statistics system 1.16 +- configurable logging system 1.17 +- event and timer handling 1.18 +- generic plugin system 1.19 +- launcher daemon 1.20 + 1.21 +The contents of nrappkit were extracted from Network Resonance's 1.22 +product on the theory that they were generally useful for 1.23 +application developers. 1.24 + 1.25 +THIS PACKAGE DOES NOT GRANT A LICENSE OR RIGHT TO ANY OTHER NETWORK 1.26 +RESONANCE TECHNOLOGY OR SOFTWARE. 1.27 + 1.28 + 1.29 + 1.30 +BUILDING 1.31 + 1.32 +Builds are done semi-manually with port directories for each 1.33 +platform. There are pre-existing ports to FreeBSD, Linux (Ubuntu 1.34 +and Fedora Core), and Darwin (MacOSX). To build the system: 1.35 + 1.36 + cd src/make/<platform> 1.37 + gmake 1.38 + 1.39 +Some of the platforms come in several variants. Most notably, 1.40 +if a platform exists in "regular" and "-appliance" variant, 1.41 +this means that the regular variant just builds binaries intended 1.42 +to be run out of the make directory (for development) and the 1.43 +appliance variant is intended to be installed in a real system. 1.44 + 1.45 +By default we want to install things owned as user "pcecap". 1.46 +Either make this user or edit the Makefile to be a user you 1.47 +like (e.g., nobody). 1.48 + 1.49 +If you want to include the 'nrsh' command-line configuration 1.50 +tool in your build, you will need to make sure the line 1.51 + BUILD_NRSH=yes 1.52 +appears (uncommented-out) in your platform Makefile. You will 1.53 +also need to to build OpenSSL and libedit and point your nrappkit 1.54 +Makefile to the correct paths. You can obtain these packages at: 1.55 + openssl-0.9.7l 1.56 + http://www.openssl.org/source/openssl-0.9.7l.tar.gz 1.57 + 1.58 + libedit-20060829-2.9 1.59 + http://freshmeat.net/redir/editline/53029/url_tgz/libedit-20060829-2.9.tar.gz 1.60 + 1.61 + 1.62 +INSTALLING 1.63 +If you're doing an appliance as opposed to a development build, 1.64 +you'll want to install it. This is easy: 1.65 + 1.66 + su 1.67 + gmake install 1.68 + 1.69 +Most binaries and libraries ends up in /usr/local/pcecap while 1.70 +data files are in /var/pcecap. However, you can tweak 1.71 +this in the Makefile. By default it's all owned by pcecap. 1.72 + 1.73 +To ensure that dynamic libraries are loaded correctly at runtime, 1.74 +you'd want to make sure the right directory is included in your 1.75 +LD_LIBRARY_PATH or via ldconfig. 1.76 + 1.77 + 1.78 +QUICK TOUR 1.79 +The build makes the following binaries that you may find useful: 1.80 + 1.81 +- captured -- the launcher (the name is historical) 1.82 +- registryd -- the registry daemon 1.83 +- nrregctl -- a registry control program 1.84 +- nrsh -- the command shell (when included in build) 1.85 +- nrstatsctl -- the stats control program 1.86 + 1.87 +Using the nrcapctl script is the easiest way to interact with 1.88 +the applications. It is run as "nrcapctl <command>" with the 1.89 +following commands recognized: 1.90 + 1.91 + startup -- fires up captured, which in turn runs and 1.92 + initializes the registry 1.93 + 1.94 + shutdown -- kills captured and its child processes 1.95 + 1.96 + status -- prints the running status of captured in 1.97 + human-readable form 1.98 + 1.99 + stat -- prints the running status of captured in 1.100 + a form easily parsed by scripts 1.101 + 1.102 + enable -- alters the mode.txt file so that captured 1.103 + starts 1.104 + 1.105 + disable -- alters the mode.txt file so that captured 1.106 + does not start 1.107 + 1.108 + clear-statistics -- equivalent to "nrstatsctl -z" (requires 1.109 + that captured be running) 1.110 + 1.111 +Note: the "start" and "stop" nrcapctl commands do nothing as they 1.112 +use components not included in nrappkit. However the associated 1.113 +script logic in nrcapctl demonstrates how additional applications 1.114 +might be launched using nrcapctl and particular registry settings. 1.115 + 1.116 + 1.117 +EXTENDING 1.118 +When things come up, they're pretty dumb. You'll probably want to 1.119 +write your own applications, otherwise it's not clear why you're doing 1.120 +this. The general idea is that you write your application using the 1.121 +facilities that nrappkit provides and then write plugins to the 1.122 +nrappkit components as necessary. So, for example, say you want 1.123 +to write a network daemon. You would: 1.124 + 1.125 + - configure the launcher to launch your daemon (using the registry, 1.126 + naturally). 1.127 + - make calls to the registry to get configuration data 1.128 + - make calls to the logging system to log data 1.129 + - implement a stats module to record statistics 1.130 + - write a plugin to nrsh to let people configure your parameters 1.131 + 1.132 +Examples of some of this stuff can be found in examples/demo_plugin. 1.133 +Otherwise, read the source. More documentation will be on the way, 1.134 +hopefully. 1.135 + 1.136 +