-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
woltest was renewed as sendwol.
- Loading branch information
Showing
11 changed files
with
582 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
MIT License | ||
BSD 2-Clause License | ||
|
||
Copyright (c) 2021 KusaReMKN | ||
Copyright (c) 2022, KusaReMKN | ||
All rights reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bin_PROGRAMS = sendwol | ||
sendwol_SOURCES = sendwol.c | ||
man_MANS = sendwol.1 | ||
EXTRA_DIST = LICENSE README.md $(man_MANS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,65 @@ | ||
# woltest | ||
Wake on LAN experiment | ||
# sendwol – a simple Wake-on-LAN client | ||
|
||
See also: https://zenn.dev/kusaremkn/articles/1c057acc19e1db | ||
## Usage | ||
|
||
## How to build | ||
For example, most simply: | ||
|
||
```console | ||
$ ./configure | ||
$ make | ||
% sendwol 00:00:5e:00:53:44 | ||
``` | ||
|
||
Multicast to all link-local nodes on IPv4: | ||
|
||
## How to use | ||
```console | ||
% sendwol -4 -a 224.0.0.1 -i eth0 00-00-5e-00-53-11 | ||
``` | ||
|
||
More details, refer the man page. | ||
|
||
```console | ||
$ woltest macaddr | ||
% man ./sendwol.1 # instantly | ||
% man sendwol # after installation | ||
``` | ||
|
||
You should specify the target MAC address as _macaddr_. | ||
|
||
## Installation | ||
|
||
1. Download the tarball from [releases page][]. | ||
|
||
2. Extract them. | ||
```console | ||
% tar xvf sendwol-*.**.tar.gz | ||
``` | ||
|
||
3. Change the working directory. | ||
```console | ||
% cd sendwol-*/. | ||
``` | ||
|
||
4. Generate `Makefile`. | ||
```console | ||
% ./configure | ||
``` | ||
|
||
5. Build the binary. | ||
```console | ||
% make | ||
``` | ||
|
||
6. Install them. | ||
```console | ||
% make install | ||
``` | ||
|
||
## Uninstallation | ||
|
||
```console | ||
% make uninstall | ||
``` | ||
|
||
|
||
## License | ||
|
||
MIT License. | ||
The 2-Clause BSD License | ||
|
||
[releases page]: https://github.com/KusaReMKN/sendwol/releases/latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- Autoconf -*- | ||
# Process this file with autoconf to produce a configure script. | ||
|
||
AC_PREREQ([2.69]) | ||
AC_INIT([sendwol], [0.01], [https://github.com/KusaReMKN/sendwol/issue]) | ||
AM_INIT_AUTOMAKE([foreign]) | ||
AC_CONFIG_SRCDIR([sendwol.c]) | ||
AC_CONFIG_HEADERS([config.h]) | ||
|
||
# Checks for programs. | ||
AC_PROG_CC | ||
|
||
# Checks for libraries. | ||
|
||
# Checks for header files. | ||
AC_CHECK_HEADERS([arpa/inet.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h]) | ||
|
||
# Checks for typedefs, structures, and compiler characteristics. | ||
AC_C_RESTRICT | ||
AC_TYPE_SSIZE_T | ||
AC_TYPE_UINT16_T | ||
AC_TYPE_UINT8_T | ||
|
||
# Checks for library functions. | ||
AC_CHECK_FUNCS([memset setlocale socket strtol]) | ||
|
||
AC_CONFIG_FILES([Makefile]) | ||
AC_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
.\" | ||
.\" Copyright (c) 2022 KusaReMKN | ||
.\" Available under the 2-Clause BSD License | ||
.\" | ||
.Dd 28th March 2022 | ||
.Dt SENDWOL 1 | ||
.Os | ||
.Sh NAME | ||
.Nm sendwol | ||
.Nd send Wake-on-LAN magic packets | ||
.Sh SYNOPSIS | ||
.Nm | ||
.Op Fl 4 | Fl 6 | ||
.Op Fl b | Fl a Ar address | Fl h Ar hostname | ||
.Op Fl i Ar interface | ||
.Op Fl p Ar port | Fl s Ar service | ||
.Ar target ... | ||
.Sh DESCRIPTION | ||
The | ||
.Nm | ||
utility wakes up the | ||
.Ar target | ||
by sending Wake-on-LAN magic packets over UDP. | ||
Obviously, the | ||
.Ar target | ||
needs to support Wake-on-LAN technology. | ||
.Pp | ||
The following options are available: | ||
.Bl -tag | ||
.It Fl 4 | ||
Force to use IPv4 only. | ||
.It Fl 6 | ||
Force to use IPv6 only. | ||
.It Fl b | ||
Use the broadcast address of the interface as destination. | ||
This is the default. | ||
.It Fl a Ar address , Fl h Ar hostname | ||
Specify the destination address or host name. | ||
.It Fl i Ar interface | ||
Specify the name of the interface from which packets are sent. | ||
This option applies only if the UDP destination is a multicast address | ||
.Pq IPv4/IPv6 , | ||
or link-local/site-local unicast address | ||
.Pq IPv6 . | ||
.It Fl p Ar port , Fl s Ar service | ||
Specify the destination port number or service name. | ||
The default value is | ||
.Ql 9 . | ||
.El | ||
.Sh EXIT STATUS | ||
.Ex -std | ||
.Sh EXAMPLES | ||
The following will broadcast Wake-on-LAN magic packets to wake up targets | ||
.Ql 00:00:5e:00:53:34 | ||
and | ||
.Ql 00:00:5e:00:53:59 . | ||
.Bd -literal -offset indent | ||
% sendwol '00:00:5e:00:53:34' '00:00:5e:00:53:59' | ||
.Ed | ||
.Pp | ||
The following will send the magic packets to all nodes | ||
on the network link attached to the interface | ||
.Ql eth0 . | ||
The address | ||
.Ql ff02::1 | ||
is named the link-local all-nodes multicast address, | ||
and the packets would reach every node on the network link. | ||
.Bd -literal -offset indent | ||
% sendwol -6 -a ff02::1 -i eth0 00-00-5e-00-53-15 | ||
.Ed | ||
.Sh SEE ALSO | ||
.Xr getaddrinfo 3 , | ||
.Xr getifaddrs 3 , | ||
.Xr inet 4 , | ||
.Xr inet6 4 , | ||
.Xr ip 4 , | ||
.Xr ip6 4 , | ||
.Xr udp 4 , | ||
.Xr ifconfig 8 | ||
.Sh COPYRIGHT | ||
Copyright \(co 2022 | ||
.An KusaReMKN Aq Lk https://github.com/KusaReMKN . | ||
.br | ||
This document and software are available under | ||
.Sy the 2-Clause BSD License . | ||
.Sh BUGS | ||
To report bugs, please create an issue. | ||
.Aq Lk https://github.com/kusaremkn/sendwol/issue |
Oops, something went wrong.