Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IP and MTU Command Line Interface Options #31

Merged
merged 8 commits into from
Mar 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions faradayio_cli/faradayio_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""faradayio-cli.faradayio-cli: provides entry point main()."""

__version__ = "0.0.3"
__version__ = "0.0.4"

import argparse
import serial
Expand Down Expand Up @@ -29,8 +29,12 @@ def setupArgparse():
parser.add_argument("id", type=int, help="ID number radio")

# Optional arguments
parser.add_argument("-i", "--addr", default="10.0.0.1",
help="Set IP Address of TUN adapter (Farday Radio)")
parser.add_argument("-l", "--loopback", action="store_true",
help="Use software loopback serial port")
parser.add_argument("-m", "--mtu", default=1500,
help="Set Maximum Transmission Unit (MTU)")
parser.add_argument("-p", "--port", default="/dev/ttyUSB0",
help="Physical serial port of radio")

Expand Down Expand Up @@ -96,7 +100,11 @@ def main():

# Setup TUN adapter and start
try:
tun = Monitor(serialPort=serialPort, name=tunName, isRunning=isRunning)
tun = Monitor(serialPort=serialPort,
name=tunName,
isRunning=isRunning,
addr=args.addr,
mtu=int(args.mtu))
tun.start()

except pytun.Error as error:
Expand Down
13 changes: 12 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
attrs==17.4.0
faradayio==0.0.3
certifi==2018.1.18
chardet==3.0.4
coverage==4.5.1
coveralls==1.2.0
docopt==0.6.2
faradayio==0.0.4
faradayio-cli==0.0.4
flake8==3.5.0
idna==2.6
mccabe==0.6.1
pluggy==0.6.0
py==1.5.2
pycodestyle==2.3.1
pyflakes==1.6.0
pyserial==3.4
pytest==3.4.1
pytest-cov==2.5.1
python-pytun==2.2.1
requests==2.18.4
scapy-python3==0.23
six==1.11.0
sliplib==0.3.0
sphinx-rtd-theme==0.2.4
timeout-decorator==0.4.0
urllib3==1.22
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,31 @@
packages=['faradayio_cli'],
install_requires=[
'attrs==17.4.0',
'faradayio==0.0.3',
'certifi==2018.1.18',
'chardet==3.0.4',
'coverage==4.5.1',
'coveralls==1.2.0',
'docopt==0.6.2',
'faradayio==0.0.4',
'faradayio-cli==0.0.4',
'flake8==3.5.0',
'idna==2.6',
'mccabe==0.6.1',
'pluggy==0.6.0',
'py==1.5.2',
'pycodestyle==2.3.1',
'pyflakes==1.6.0',
'pyserial==3.4',
'pytest==3.4.1',
'pytest-cov==2.5.1',
'python-pytun==2.2.1',
'requests==2.18.4',
'scapy-python3==0.23',
'six==1.11.0',
'sliplib==0.3.0',
'sphinx-rtd-theme==0.2.4',
'timeout-decorator==0.4.0',
'urllib3==1.22',
],
entry_points={
"console_scripts": ['faradayio-cli = faradayio_cli.faradayio_cli:main']
Expand Down