nmrp-flash -> nmrpflash

This commit is contained in:
Joseph C. Lehner 2016-02-08 16:18:21 +01:00
parent d94e849b16
commit 904a81b50e
9 changed files with 42 additions and 43 deletions

View file

@ -5,8 +5,8 @@ LIBS = -lpcap
.PHONY: clean install release release/osx release/linux .PHONY: clean install release release/osx release/linux
nmrp-flash: nmrp.o tftp.o ethsock.o main.o nmrpflash: nmrp.o tftp.o ethsock.o main.o
$(CC) $(CFLAGS) -o nmrp-flash nmrp.o tftp.o ethsock.o main.o $(LIBS) $(CC) $(CFLAGS) -o nmrpflash nmrp.o tftp.o ethsock.o main.o $(LIBS)
nmrp.o: nmrp.c nmrpd.h nmrp.o: nmrp.c nmrpd.h
$(CC) $(CFLAGS) -c -o nmrp.o nmrp.c $(CC) $(CFLAGS) -c -o nmrp.o nmrp.c
@ -21,17 +21,16 @@ main.o: main.c nmrpd.h
$(CC) $(CFLAGS) -c -o main.o main.c $(CC) $(CFLAGS) -c -o main.o main.c
clean: clean:
rm -f nmrp.o tftp.o main.o ethsock.o nmrp-flash nmrp-flash.exe rm -f nmrp.o tftp.o main.o ethsock.o nmrpflash nmrpflash.exe
install: nmrp-flash install: nmrpflash
install -m 755 nmrp-flash $(PREFIX)/bin install -m 755 nmrpflash $(PREFIX)/bin
release/osx: release/osx:
CFLAGS="-arch i686 -arch x86_64" make release CFLAGS="-arch i686 -arch x86_64" make release
cp nmrp-flash binaries/osx/
release/linux: release release/linux: release
cp nmrp-flash binaries/linux/ cp nmrpflash binaries/linux/
release: clean nmrp-flash release: clean nmrpflash
strip nmrp-flash strip nmrpflash

View file

@ -1,4 +1,4 @@
nmrp-flash - Netgear Unbrick Utility nmrpflash - Netgear Unbrick Utility
==================================== ====================================
This program uses Netgear's [NMRP protocol] This program uses Netgear's [NMRP protocol]
@ -6,7 +6,7 @@ This program uses Netgear's [NMRP protocol]
to flash a new firmware image to a compatible device. This utility has been to flash a new firmware image to a compatible device. This utility has been
tested with a Netgear EX2700, but is likely to work on many others as well. tested with a Netgear EX2700, but is likely to work on many others as well.
### Using nmrp-flash ### Using nmrpflash
Connect your Netgear router to your computer using a network cable. Connect your Netgear router to your computer using a network cable.
Assign a static IP address to your computer (more specifically, to Assign a static IP address to your computer (more specifically, to
@ -19,17 +19,17 @@ In this example, we'll use `192.168.1.2`. All available network interfaces
can be listed using can be listed using
```` ````
$ nmrp-flash -L $ nmrpflash -L
eth0 192.168.1.2 f2:11:a1:02:03:b1 eth0 192.168.1.2 f2:11:a1:02:03:b1
```` ````
Now we can start `nmrp-flash`. The argument for the `-a` option needs Now we can start `nmrpflash`. The argument for the `-a` option needs
to be a *free* IP address from the same subnet as the one used by your to be a *free* IP address from the same subnet as the one used by your
network interface. We'll use `192.168.1.254`. The firmware image file network interface. We'll use `192.168.1.254`. The firmware image file
can usually be downloaded directly from Netgear's FTP servers. can usually be downloaded directly from Netgear's FTP servers.
```` ````
$ nmrp-flash -i eth0 -a 192.168.1.254 -f EX2700-V1.0.1.8.img $ nmrpflash -i eth0 -a 192.168.1.254 -f EX2700-V1.0.1.8.img
Advertising NMRP server on eth0 ... / Advertising NMRP server on eth0 ... /
Received configuration request from a4:2b:8c:00:00:01. Received configuration request from a4:2b:8c:00:00:01.
Sending configuration: ip 192.168.1.254, mask 255.255.255.0. Sending configuration: ip 192.168.1.254, mask 255.255.255.0.
@ -49,7 +49,7 @@ $ make && sudo make install
The repository includes a The repository includes a
[DevCpp](http://sourceforge.net/projects/orwelldevcpp/) [DevCpp](http://sourceforge.net/projects/orwelldevcpp/)
project file (`nmrp-flash.dev`). Download the latest project file (`nmrpflash.dev`). Download the latest
[WinPcap Developer Pack](http://www.winpcap.org/devel.htm) [WinPcap Developer Pack](http://www.winpcap.org/devel.htm)
and extract it into the root folder of the nmrp-flash sources. and extract it into the root folder of the nmrpflash sources.

Binary file not shown.

Binary file not shown.

22
main.c
View file

@ -1,19 +1,19 @@
/** /**
* nmrp-flash - Netgear Unbrick Utility * nmrpflash - Netgear Unbrick Utility
* Copyright (C) 2016 Joseph Lehner <joseph.c.lehner@gmail.com> * Copyright (C) 2016 Joseph Lehner <joseph.c.lehner@gmail.com>
* *
* nmrp-flash is free software: you can redistribute it and/or modify * nmrpflash is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* nmrp-flash is distributed in the hope that it will be useful, * nmrpflash is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with nmrp-flash. If not, see <http://www.gnu.org/licenses/>. * along with nmrpflash. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
@ -30,7 +30,7 @@ int verbosity = 0;
void usage(FILE *fp) void usage(FILE *fp)
{ {
fprintf(fp, fprintf(fp,
"Usage: nmrp-flash [OPTIONS...]\n" "Usage: nmrpflash [OPTIONS...]\n"
"\n" "\n"
"Options (-a, -i and -f are mandatory):\n" "Options (-a, -i and -f are mandatory):\n"
" -a <ipaddr> IP address to assign to target device\n" " -a <ipaddr> IP address to assign to target device\n"
@ -52,14 +52,14 @@ void usage(FILE *fp)
"Example:\n" "Example:\n"
"\n" "\n"
#ifndef NMRPFLASH_WINDOWS #ifndef NMRPFLASH_WINDOWS
"$ sudo nmrp-flash -i eth0 -a 192.168.1.254 -f firmware.bin\n" "$ sudo nmrpflash -i eth0 -a 192.168.1.254 -f firmware.bin\n"
#else #else
"C:\\> nmrp-flash.exe -i net0 -a 192.168.1.254 -f firmware.bin\n" "C:\\> nmrpflash.exe -i net0 -a 192.168.1.254 -f firmware.bin\n"
#endif #endif
"\n" "\n"
"nmrp-flash %s, Copyright (C) 2016 Joseph C. Lehner\n" "nmrpflash %s, Copyright (C) 2016 Joseph C. Lehner\n"
"nmrp-flash is free software, licensed under the GNU GPLv3.\n" "nmrpflash is free software, licensed under the GNU GPLv3.\n"
"Source code at https://github.com/jclehner/nmrp-flash\n" "Source code at https://github.com/jclehner/nmrpflash\n"
"\n", "\n",
NMRPFLASH_VERSION NMRPFLASH_VERSION
); );
@ -131,7 +131,7 @@ int main(int argc, char **argv)
break; break;
case 'V': case 'V':
printf("nmrp-flash %s\n", NMRPFLASH_VERSION); printf("nmrpflash %s\n", NMRPFLASH_VERSION);
val = 0; val = 0;
goto out; goto out;
case 'v': case 'v':

View file

@ -1,6 +1,6 @@
[Project] [Project]
FileName=nmrp-flash.dev FileName=nmrpflash.dev
Name=nmrp-flash Name=nmrpflash
Type=1 Type=1
Ver=2 Ver=2
ObjFiles= ObjFiles=
@ -19,7 +19,7 @@ ObjectOutput=Obj
LogOutput= LogOutput=
LogOutputEnabled=0 LogOutputEnabled=0
OverrideOutput=0 OverrideOutput=0
OverrideOutputName=nmrp-flash.exe OverrideOutputName=nmrpflash.exe
HostApplication= HostApplication=
UseCustomMakefile=0 UseCustomMakefile=0
CustomMakefile= CustomMakefile=

8
nmrp.c
View file

@ -1,19 +1,19 @@
/** /**
* nmrp-flash - Netgear Unbrick Utility * nmrpflash - Netgear Unbrick Utility
* Copyright (C) 2016 Joseph Lehner <joseph.c.lehner@gmail.com> * Copyright (C) 2016 Joseph Lehner <joseph.c.lehner@gmail.com>
* *
* nmrp-flash is free software: you can redistribute it and/or modify * nmrpflash is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* nmrp-flash is distributed in the hope that it will be useful, * nmrpflash is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with nmrp-flash. If not, see <http://www.gnu.org/licenses/>. * along with nmrpflash. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */

10
nmrpd.h
View file

@ -1,19 +1,19 @@
/** /**
* nmrp-flash - Netgear Unbrick Utility * nmrpflash - Netgear Unbrick Utility
* Copyright (C) 2016 Joseph Lehner <joseph.c.lehner@gmail.com> * Copyright (C) 2016 Joseph Lehner <joseph.c.lehner@gmail.com>
* *
* nmrp-flash is free software: you can redistribute it and/or modify * nmrpflash is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* nmrp-flash is distributed in the hope that it will be useful, * nmrpflash is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with nmrp-flash. If not, see <http://www.gnu.org/licenses/>. * along with nmrpflash. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
@ -30,7 +30,7 @@
#define NMRPFLASH_OSX #define NMRPFLASH_OSX
#elif defined(__unix__) #elif defined(__unix__)
#define NMRPFLASH_UNIX #define NMRPFLASH_UNIX
#warning "nmrp-flash is not fully supported on your operating system" #warning "nmrpflash is not fully supported on your operating system"
#endif #endif
#ifndef NMRPFLASH_WINDOWS #ifndef NMRPFLASH_WINDOWS

8
tftp.c
View file

@ -1,19 +1,19 @@
/** /**
* nmrp-flash - Netgear Unbrick Utility * nmrpflash - Netgear Unbrick Utility
* Copyright (C) 2016 Joseph Lehner <joseph.c.lehner@gmail.com> * Copyright (C) 2016 Joseph Lehner <joseph.c.lehner@gmail.com>
* *
* nmrp-flash is free software: you can redistribute it and/or modify * nmrpflash is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* nmrp-flash is distributed in the hope that it will be useful, * nmrpflash is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with nmrp-flash. If not, see <http://www.gnu.org/licenses/>. * along with nmrpflash. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */