Skip to content

Commit e78e374

Browse files
committed
Few cosmetic changes to linux and MacOS configuration scripts
1 parent a48d349 commit e78e374

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

configure-linux.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ function HELP {
1717
echo " 2) With switches, as described below"
1818
echo ""
1919
echo -e "${REV}Basic usage:${NORM} ${BOLD}$SCRIPT [-h] [--pf-ring] [--pf-ring-home] [--dpdk] [--dpdk-home] [--use-immediate-mode] ${NORM}"\\n
20-
echo "The following switches are recognized."
21-
echo "${REV}--default${NORM} --Setup PcapPlusPlus for Linux without PF_RING or DPDK. In this case you must not set --pf-ring or --dpdk"
20+
echo "The following switches are recognized:"
21+
echo "${REV}--default${NORM} --Setup PcapPlusPlus for Linux without PF_RING or DPDK. In this case you must not set --pf-ring or --dpdk"
2222
echo ""
23-
echo "${REV}--pf-ring${NORM} --Setup PcapPlusPlus with PF_RING. In this case you must also set --pf-ring-home"
24-
echo "${REV}--pf-ring-home${NORM} --Sets PF_RING home directory. Use only when --pf-ring is set"
23+
echo "${REV}--pf-ring${NORM} --Setup PcapPlusPlus with PF_RING. In this case you must also set --pf-ring-home"
24+
echo "${REV}--pf-ring-home${NORM} --Sets PF_RING home directory. Use only when --pf-ring is set"
2525
echo ""
26-
echo "${REV}--dpdk${NORM} --Setup PcapPlusPlus with DPDK. In this case you must also set --dpdk-home"
27-
echo "${REV}--dpdk-home${NORM} --Sets DPDK home directoy. Use only when --dpdk is set"
28-
echo "${REV}--use-immediate-mode --Sets pcap_set_immediate_mode to 1"
26+
echo "${REV}--dpdk${NORM} --Setup PcapPlusPlus with DPDK. In this case you must also set --dpdk-home"
27+
echo "${REV}--dpdk-home${NORM} --Sets DPDK home directoy. Use only when --dpdk is set"
2928
echo ""
30-
echo -e "${REV}-h|--help${NORM} --Displays this help message and exits. No further functions are performed."\\n
29+
echo "${REV}--use-immediate-mode${NORM} --Use libpcap immediate mode which enables getting packets as fast as possible (supported on libpcap>=1.5)"
30+
echo ""
31+
echo -e "${REV}-h|--help${NORM} --Displays this help message and exits. No further actions are performed"\\n
3132
echo -e "Examples:"
3233
echo -e " ${BOLD}$SCRIPT --default${NORM}"
34+
echo -e " ${BOLD}$SCRIPT --use-immediate-mode${NORM}"
3335
echo -e " ${BOLD}$SCRIPT --pf-ring --pf-ring-home /home/myuser/PF_RING${NORM}"
3436
echo -e " ${BOLD}$SCRIPT --dpdk --dpdk-home /home/myuser/dpdk-2.1.0${NORM}"
3537
echo ""
@@ -144,9 +146,10 @@ else
144146
fi
145147
shift 2 ;;
146148

147-
--use-immediate-mode)
148-
HAS_PCAP_IMMEDIATE_MODE=1
149-
shift ;;
149+
# enable libpcap immediate mode
150+
--use-immediate-mode)
151+
HAS_PCAP_IMMEDIATE_MODE=1
152+
shift ;;
150153

151154
# help switch - display help and exit
152155
-h|--help)

configure-mac_os_x.sh

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ SCRIPT=`basename ${BASH_SOURCE[0]}`
1212
# help function
1313
function HELP {
1414
echo -e \\n"Help documentation for ${BOLD}${SCRIPT}.${NORM}"\\n
15-
echo "This script has 2 modes of operation:"
16-
echo ""
1715
echo -e "${REV}Basic usage:${NORM} ${BOLD}$SCRIPT [-h] [--use-immediate-mode] ${NORM}"\\n
18-
echo "The following switches are recognized."
19-
echo "${REV}--use-immediate-mode --Sets pcap_set_immediate_mode to 1"
16+
echo "The following switches are recognized:"
17+
echo "${REV}--use-immediate-mode${NORM} --Use libpcap immediate mode which enables getting packets as fast as possible (supported on libpcap>=1.5)"
2018
echo ""
21-
echo -e "${REV}-h|--help${NORM} --Displays this help message and exits. No further functions are performed."\\n
19+
echo -e "${REV}-h|--help${NORM} --Displays this help message and exits. No further actions are performed"\\n
2220
echo -e "Examples:"
23-
echo -e " ${BOLD}$SCRIPT --default${NORM}"
21+
echo -e " ${BOLD}$SCRIPT${NORM}"
2422
echo -e " ${BOLD}$SCRIPT --use-immediate-mode${NORM}"
2523
echo ""
2624
exit 1
@@ -43,26 +41,27 @@ do
4341
case $i in
4442
# default switch - do nothing basically
4543
--default)
46-
shift ;;
44+
shift ;;
4745

46+
# enable libpcap immediate mode
4847
--use-immediate-mode)
49-
HAS_PCAP_IMMEDIATE_MODE=1
50-
shift ;;
48+
HAS_PCAP_IMMEDIATE_MODE=1
49+
shift ;;
5150

5251
# help switch - display help and exit
5352
-h|--help)
54-
HELP
55-
;;
53+
HELP
54+
;;
5655

5756
# empty switch - just go on
5857
--)
59-
shift ; break ;;
58+
shift ; break ;;
6059

6160
# illegal switch
6261
*)
63-
echo -e \\n"Option -${BOLD}$OPTARG${NORM} not allowed."
64-
HELP
65-
;;
62+
echo -e \\n"Option -${BOLD}$OPTARG${NORM} not allowed."
63+
HELP
64+
;;
6665
esac
6766
done
6867

0 commit comments

Comments
 (0)