Skip to content

Commit

Permalink
Merge branch 'master' into compact-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
verrens authored Aug 3, 2024
2 parents e130318 + 469e1bc commit 748de4b
Show file tree
Hide file tree
Showing 27 changed files with 1,612 additions and 400 deletions.
14 changes: 14 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[flake8]

select =
E902,
E999,
S,
F,

ignore =
F821

per-file-ignores =
test/*: S603,S404

35 changes: 35 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test compilation
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install flake8
run: pip3 install flake8==3.9.2 flake8-bandit==2.1.2 bandit==1.7.2
- name: Run flake8
run: python3 -m flake8 .
compile-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: egor-tensin/[email protected]
with:
version: latest
platform: x64
- name: Bootstrap
run: ./bootstrap.sh
- name: Configure
run: ./configure --without-gtk --without-jansson
- name: Make
run: make -j $(nproc)
- name: Run sample mtr against 1.1.1.1
run: ./mtr --report --report-cycles 1 -m 1 1.1.1.1
- name: Run test - cmdparse.py
run: python3 ./test/cmdparse.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ stamp-h1*
/test/*.py.trs

/mtr-*.tar.gz
*.swp
4 changes: 2 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ V0.88
build-sys: default to ,/configure --enable-silent-rules
warnings: do not take abs() when data type is unsigned
warnings: mark unused function input variables
warnings: fix couple unsigned vs signed variable comparisions
warnings: fix couple unsigned vs signed variable comparisons
warnings: multiply timeval seconds only when the value is small
warnings: fix some missed unsigned vs signed variable comparisions
warnings: fix some missed unsigned vs signed variable comparisons
comment: add value range note to initialization
cast: do not downgrade to float when double should be used
warnings: remove dead code
Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,29 @@ to the "trusted" directory.)

Building on MacOS should not require any special steps.

BUILDING FOR WINDOWS
USING MTR ON WINDOWS
===

Building for Windows requires Cygwin. To obtain Cygwin, see
Using mtr on Windows requires Windows Subsystem for Linux (WSL).
To install WSL with Ubuntu distribution (Default), see
[How to install Linux on Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/install).

After complete initial process,
simple as:

sudo apt-get -y install mtr



BUILDING FOR WINDOWS (TRADITIONAL METHOD)
===

If you prefer traditional method.
Obtain Cygwin, see
https://cygwin.com/install.html.

Next, re-run cygwin's `setup-x86.exe` (or `setup-x86_64.exe` if you're using 64bit cygwin) with the following arguments,

which will install the packages required for building:

setup-x86.exe --package-manager --wait --packages automake,pkg-config,make,gcc-core,libncurses-devel,libjansson-devel
Expand All @@ -89,6 +106,8 @@ Finally, install the built binaries:
make install




WHERE CAN I GET THE LATEST VERSION OR MORE INFORMATION?
===

Expand Down
12 changes: 8 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ m4_ifndef([PKG_CHECK_MODULES], [m4_defun([PKG_CHECK_MODULES], [AC_MSG_ERROR(
[Could not locate the pkg-config autoconf macros. These are usually located
in /usr/share/aclocal/pkg.m4. If your macros are in a different location,
try setting the environment variable ACLOCAL_OPTS="-I/other/macro/dir"
before running ./bootstrap.sh again, or configure --without-gtk ----without-jansson ])])
before running ./bootstrap.sh again, or configure --without-gtk --without-jansson ])])
])
PKG_PROG_PKG_CONFIG

Expand Down Expand Up @@ -127,9 +127,13 @@ AS_IF([test "x$with_ncurses" = "xyes"],
])
AM_CONDITIONAL([WITH_CURSES], [test "x$with_ncurses" = xyes])

AC_CHECK_LIB([cap], [cap_set_proc], [have_cap="yes"],
AS_IF([test "$host_os" = linux-gnu],
AC_MSG_WARN([Capabilities support is strongly recommended for increased security. See SECURITY for more information.])))
have_cap="yes"
AC_CHECK_LIB([cap], [cap_set_proc], [], [
have_cap="no"
AS_IF([test "$host_os" = linux-gnu], [
AC_MSG_WARN([Capabilities support is strongly recommended for increased security. See SECURITY for more information.])
])
])

# Enable ipinfo
AC_ARG_WITH([ipinfo],
Expand Down
20 changes: 20 additions & 0 deletions man/mtr.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ mtr \- a network diagnostic tool
.B \-\-aslookup\c
]
[\c
.BI \-\-ipinfo_provider4 \ DOMAIN\c
]
[\c
.BI \-\-ipinfo_provider6 \ DOMAIN\c
]
[\c
.BI \-i \ INTERVAL\c
]
[\c
Expand Down Expand Up @@ -92,6 +98,9 @@ mtr \- a network diagnostic tool
.BI \-U \ MAX\-UNKNOWN\c
]
[\c
.BI \-E \ MAX\-DISPLAY\-PATH\c
]
[\c
.B \-\-udp\c
]
[\c
Expand Down Expand Up @@ -347,6 +356,14 @@ Example (columns to the right not shown for clarity):
7. AS1850 www.isnic.is
.fi
.TP
.B \-\-ipinfo_provider4 \fIDOMAIN
Provider for IPv4 AS lookups. Defaults to origin.asn.cymru.com.
.fi
.TP
.B \-\-ipinfo_provider6 \fIDOMAIN
Provider for IPv6 AS lookups. Defaults to origin6.asn.cymru.com.
.fi
.TP
.B \-i \fISECONDS\fR, \fB\-\-interval \fISECONDS
Use this option to specify the positive number of seconds between ICMP
ECHO requests. The default value for this parameter is one second. The
Expand Down Expand Up @@ -407,6 +424,9 @@ probe. Default is 30.
.B \-U \fINUM\fR, \fB\-\-max-unknown \fINUM
Specifies the maximum unknown host. Default is 5.
.TP
.B \-E \fINUM\fR, \fB\-\-max-display-path \fINUM
Specifies the maximum number of ECMP paths to display. Default is 8.
.TP
.B \-u\fR, \fB\-\-udp
Use UDP datagrams instead of ICMP ECHO.
.TP
Expand Down
5 changes: 5 additions & 0 deletions packet/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ bool decode_probe_argument(
param->local_address = value;
}

/* Device name to send from */
if (!strcmp(name, "local-device")) {
param->local_device = value;
}

/* Protocol for the probe */
if (!strcmp(name, "protocol")) {
if (!strcmp(value, "icmp")) {
Expand Down
Loading

0 comments on commit 748de4b

Please sign in to comment.