Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
f97801ae
Commit
f97801ae
authored
May 09, 2008
by
David Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ifdef out emulab-specific stuff on request
parent
319eba0a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
tools/rmanage/rmanage.c
tools/rmanage/rmanage.c
+12
-2
No files found.
tools/rmanage/rmanage.c
View file @
f97801ae
...
@@ -11,8 +11,10 @@
...
@@ -11,8 +11,10 @@
#include <errno.h>
#include <errno.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#ifndef NO_EMULAB
#include <mysql/mysql.h>
#include <mysql/mysql.h>
#include "tbdb.h"
#include "tbdb.h"
#endif
extern
char
*
optarg
;
extern
char
*
optarg
;
extern
int
optopt
;
extern
int
optopt
;
...
@@ -54,9 +56,10 @@ void usage(char *prog) {
...
@@ -54,9 +56,10 @@ void usage(char *prog) {
" -d Turn on debugging (more d's mean more debug info)
\n
"
" -d Turn on debugging (more d's mean more debug info)
\n
"
" -s Use secure RMCP
\n
"
" -s Use secure RMCP
\n
"
" -H Interpret keys as hex strings instead of char strings
\n
"
" -H Interpret keys as hex strings instead of char strings
\n
"
#ifndef NO_EMULAB
" -E Resolve client and keys using the Emulab database
\n
"
" -E Resolve client and keys using the Emulab database
\n
"
#endif
" (this option implies -H)
\n
"
" (this option implies -H)
\n
"
" -c host The hostname of the managed client
\n
"
" -t timeout Timeout (in seconds) for individual RMCP messages
\n
"
" -t timeout Timeout (in seconds) for individual RMCP messages
\n
"
" (default: %d)
\n
"
" (default: %d)
\n
"
" -m retries Retry N times for unacknowledged RMCP sends
\n
"
" -m retries Retry N times for unacknowledged RMCP sends
\n
"
...
@@ -67,7 +70,10 @@ void usage(char *prog) {
...
@@ -67,7 +70,10 @@ void usage(char *prog) {
" -g key Use this generation key
\n
"
" -g key Use this generation key
\n
"
" -u uid Send the specified username
\n
"
" -u uid Send the specified username
\n
"
"
\n
"
"
\n
"
" clientname IP or hostname (or Emulab node_id if -E specified)
\n
"
" clientname IP or hostname
\n
"
#ifndef NO_EMULAB
" (or Emulab node_id if -E specified)
\n
"
#endif
" command This argument performs an operation on the managed
\n
"
" command This argument performs an operation on the managed
\n
"
" client. The available commands are:
\n
"
,
" client. The available commands are:
\n
"
,
prog
,
DEFAULT_TIMEOUT
,
DEFAULT_RETRIES
);
prog
,
DEFAULT_TIMEOUT
,
DEFAULT_RETRIES
);
...
@@ -105,9 +111,11 @@ int main(int argc,char **argv) {
...
@@ -105,9 +111,11 @@ int main(int argc,char **argv) {
char
*
command
=
NULL
;
char
*
command
=
NULL
;
int
emulab
=
0
;
int
emulab
=
0
;
char
emip
[
16
];
char
emip
[
16
];
#ifndef NO_EMULAB
MYSQL_RES
*
res
;
MYSQL_RES
*
res
;
MYSQL_ROW
row
;
MYSQL_ROW
row
;
int
nrows
;
int
nrows
;
#endif
char
*
src
;
char
*
src
;
int
clen
;
int
clen
;
...
@@ -193,6 +201,7 @@ int main(int argc,char **argv) {
...
@@ -193,6 +201,7 @@ int main(int argc,char **argv) {
ctx
=
rmcp_ctx_init
(
timeout
,
retries
);
ctx
=
rmcp_ctx_init
(
timeout
,
retries
);
#ifndef NO_EMULAB
if
(
emulab
)
{
if
(
emulab
)
{
dbinit
();
dbinit
();
/* Attempt lookup in Emulab db */
/* Attempt lookup in Emulab db */
...
@@ -275,6 +284,7 @@ int main(int argc,char **argv) {
...
@@ -275,6 +284,7 @@ int main(int argc,char **argv) {
client
=
emip
;
client
=
emip
;
}
}
#endif
if
(
secure
)
{
if
(
secure
)
{
if
(
strcmp
(
role
,
"administrator"
)
==
0
)
{
if
(
strcmp
(
role
,
"administrator"
)
==
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment