diff options
author | June McEnroe <june@causal.agency> | 2019-08-28 17:01:44 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-08-28 17:01:44 -0400 |
commit | a9823f773a897f0138ead62913031a9bcc87d7fc (patch) | |
tree | 58e9d1746e9c55b73ee854e74429e4b6027f054f /bin/wake.c | |
parent | Add The Fated Sky (diff) | |
download | src-a9823f773a897f0138ead62913031a9bcc87d7fc.tar.gz src-a9823f773a897f0138ead62913031a9bcc87d7fc.zip |
Remove wake
RIP again, thursday. I don't think the RPi3 even knows how to suspend.
Diffstat (limited to 'bin/wake.c')
-rw-r--r-- | bin/wake.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/bin/wake.c b/bin/wake.c deleted file mode 100644 index 59aea68c..00000000 --- a/bin/wake.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 2017 C. McEnroe <june@causal.agency> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <sys/types.h> - -#include <err.h> -#include <netinet/in.h> -#include <stdlib.h> -#include <sys/socket.h> -#include <sysexits.h> - -typedef unsigned char byte; - -#define MAC 0x04, 0x7D, 0x7B, 0xD5, 0x6A, 0x53 -static const byte Payload[102] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - MAC, MAC, MAC, MAC, MAC, MAC, MAC, MAC, - MAC, MAC, MAC, MAC, MAC, MAC, MAC, MAC, -}; - -int main() { - int sock = socket(PF_INET, SOCK_DGRAM, 0); - if (sock < 0) err(EX_OSERR, "socket"); - - int on = 1; - int error = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); - if (error) err(EX_OSERR, "setsockopt"); - - struct sockaddr_in addr = { - .sin_family = AF_INET, - .sin_port = 9, - .sin_addr.s_addr = INADDR_BROADCAST, - }; - ssize_t size = sendto( - sock, Payload, sizeof(Payload), 0, - (struct sockaddr *)&addr, sizeof(addr) - ); - if (size < 0) err(EX_IOERR, "sendto"); - - return EX_OK; -} |