Commit 0270e6af authored by Russ Fish's avatar Russ Fish
Browse files

Retire my copy of the rude/crude patch. It's merged with Mike's in Linktest now.

parent 6d6bd978
*** crude/main.c.orig Thu Jun 13 06:15:21 2002
--- crude_main.c Thu Feb 2 17:18:17 2006
***************
*** 35,42 ****
--- 35,44 ----
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/time.h>
+ #ifndef __CYGWIN__
#include <sched.h>
#include <sys/mman.h>
+ #endif /* ifndef__CYGWIN__ */
#include <arpa/inet.h>
#include <netinet/in.h>
#include <limits.h>
***************
*** 106,112 ****
--- 108,116 ----
long temp1 = 0;
int ps_flag = 0;
struct sigaction action;
+ #ifndef __CYGWIN__
struct sched_param p;
+ #endif /* ifndef__CYGWIN__ */
char *sptr, *eptr;
struct flow_stat *newflows;
***************
*** 205,212 ****
--- 209,220 ----
retval = -2;
}
if(user_id != 0){
+ #ifndef __CYGWIN__
fprintf(stderr,"crude: must be root to set the priority level\n");
retval = -2;
+ #else /* ifndef__CYGWIN__ */
+ fprintf(stderr,"crude: priority level is not supported on Cygwin\n");
+ #endif /* ifndef__CYGWIN__ */
}
} else {
RUDEBUG1("crude: invalid commandline arguments!\n");
***************
*** 288,293 ****
--- 296,302 ----
/* (if retval < 0 -> ERROR or/and EXIT IMMEDIATELY) */
if(retval < 0){ goto crude_exit; }
+ #ifndef __CYGWIN__
/*
* If this process is owned by root we can do some tricks to
* improve the performance... (the -P option)
***************
*** 306,312 ****
goto crude_exit;
}
RUDEBUG7("crude: program priority set to %d\n", p.sched_priority);
! }
/* Activate the signal handler(s) */
memset(&action, 0, sizeof(struct sigaction));
--- 315,322 ----
goto crude_exit;
}
RUDEBUG7("crude: program priority set to %d\n", p.sched_priority);
! }
! #endif /* ifndef__CYGWIN__ */
/* Activate the signal handler(s) */
memset(&action, 0, sizeof(struct sigaction));
***************
*** 332,337 ****
--- 342,348 ----
crude_exit:
if (retval >= 0 && nflows > 0) { ps_flag = 1; }
+ #ifndef __CYGWIN__
/*
* Restore the tweaked settings...
*/
***************
*** 348,354 ****
/* Release the locked memory */
munlockall();
! }
if(ps_flag){ print_stats(); }
if(main_file > 0){ close(main_file); }
--- 359,366 ----
/* Release the locked memory */
munlockall();
! }
! #endif /* ifndef__CYGWIN__ */
if(ps_flag){ print_stats(); }
if(main_file > 0){ close(main_file); }
***************
*** 384,392 ****
--- 396,407 ----
*/
void crude_handler(int value)
{
+ #ifndef __CYGWIN__
struct sched_param pri;
+ #endif /* ifndef__CYGWIN__ */
RUDEBUG7("\ncrude: SIGNAL caught - exiting...\n");
+ #ifndef __CYGWIN__
/* Check & restore process priority */
if((getuid() == 0) && (sched_getscheduler(0) != SCHED_OTHER)){
pri.sched_priority = 0;
***************
*** 395,401 ****
} else {
RUDEBUG7("crude_handler: crude priority restored\n");
}
! }
if(nflows > 0){ print_stats(); }
if(main_file > 0){ close(main_file); }
--- 410,417 ----
} else {
RUDEBUG7("crude_handler: crude priority restored\n");
}
! }
! #endif /* ifndef__CYGWIN__ */
if(nflows > 0){ print_stats(); }
if(main_file > 0){ close(main_file); }
*** rude/flow_txmit.c~ Thu Jun 13 06:15:21 2002
--- rude/flow_txmit.c Wed Nov 9 10:50:46 2005
***************
*** 29,36 ****
--- 29,38 ----
#include <string.h>
#include <unistd.h>
#include <errno.h>
+ #ifndef __CYGWIN__
#include <sched.h>
#include <sys/mman.h>
+ #endif /* ifndef__CYGWIN__ */
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
*** rude/main.c.orig Thu Jun 13 06:15:21 2002
--- rude_main.c Thu Feb 2 17:18:19 2006
***************
*** 31,42 ****
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
- #include <sys/mman.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sched.h>
#include <arpa/inet.h>
#include <netinet/in.h>
--- 31,44 ----
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/socket.h>
+ #ifndef __CYGWIN__
#include <sched.h>
+ #include <sys/mman.h>
+ #endif /* ifndef__CYGWIN__ */
#include <arpa/inet.h>
#include <netinet/in.h>
***************
*** 82,88 ****
--- 84,92 ----
int retval = 0;
uid_t user_id = getuid();
struct sigaction action;
+ #ifndef __CYGWIN__
struct sched_param p;
+ #endif /* ifndef__CYGWIN__ */
printf("rude version %s, Copyright (C) 1999 Juha Laine and Sampo Saaristo\n"
"rude comes with ABSOLUTELY NO WARRANTY!\n"
***************
*** 138,145 ****
--- 142,153 ----
retval = -2;
}
if(user_id != 0){
+ #ifndef __CYGWIN__
fprintf(stderr,"rude: must be root to set the priority level\n");
retval = -2;
+ #else /* ifndef__CYGWIN__ */
+ fprintf(stderr,"rude: priority level is not supported on Cygwin\n");
+ #endif /* ifndef__CYGWIN__ */
}
} else {
RUDEBUG1("rude: invalid commandline arguments!\n");
***************
*** 198,203 ****
--- 206,212 ----
goto rude_exit1;
}
+ #ifndef __CYGWIN__
/*
* If this process is owned by root we can do some tricks to
* improve the performance... (the -P option)
***************
*** 217,222 ****
--- 226,232 ----
}
RUDEBUG7("rude: program priority set to %d\n", p.sched_priority);
}
+ #endif /* ifndef__CYGWIN__ */
/*
* All is fine - start looping & transmitting
***************
*** 229,234 ****
--- 239,245 ----
rude_exit:
+ #ifndef __CYGWIN__
/*
* Restore the tweaked settings...
*/
***************
*** 245,250 ****
--- 256,262 ----
/* Release the locked memory */
munlockall();
}
+ #endif /* ifndef__CYGWIN__ */
rude_exit1:
***************
*** 262,270 ****
--- 274,285 ----
void rude_handler(int value)
{
int ret_val = (value * (-1));
+ #ifndef __CYGWIN__
struct sched_param pri;
+ #endif /* ifndef__CYGWIN__ */
RUDEBUG7("\nrude_handler(): receiver SIGNAL %d - clean-up & exit\n",value);
+ #ifndef __CYGWIN__
/* Check & restore process priority */
if((getuid() == 0) && (sched_getscheduler(0) != SCHED_OTHER)){
pri.sched_priority = 0;
***************
*** 276,281 ****
--- 291,297 ----
}
munlockall();
+ #endif /* ifndef__CYGWIN__ */
clean_up();
exit(ret_val);
} /* main() */
*** rude/rude.8~ Thu Jun 13 06:15:21 2002
--- rude/rude.8 Wed Nov 9 15:09:55 2005
***************
*** 35,41 ****
The script
.IB file
describing the flows to be sent by the rude program.
! See ../rude/DOC/example.cfg, for an example.
.IP \fB\-h
Print a short help.
.IP \fB\-v
--- 35,41 ----
The script
.IB file
describing the flows to be sent by the rude program.
! See /usr/share/doc/rude/example.cfg, for an example.
.IP \fB\-h
Print a short help.
.IP \fB\-v
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment