mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
Kernel 5.4 RUTX support
This commit is contained in:
parent
839fcf1cab
commit
cfce9f52b2
7376 changed files with 3902 additions and 546 deletions
29
common/package/boot/uboot-ipq40xx/src/httpd/Makefile
Normal file
29
common/package/boot/uboot-ipq40xx/src/httpd/Makefile
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#
|
||||
# Makefile for http stuff
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
# Suppress warnings when building with size optimization
|
||||
CFLAGS += -fno-strict-aliasing
|
||||
|
||||
LIB = libhttpd.o
|
||||
OBJS += uip.o \
|
||||
uip_arch.o \
|
||||
uip_arp.o \
|
||||
httpd.o \
|
||||
fs.o
|
||||
|
||||
all: $(LIB)
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(AR) crv $@ $(OBJS)
|
||||
|
||||
#########################################################################
|
||||
|
||||
.depend: Makefile fsdata.c $(OBJS:.o=.c)
|
||||
$(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
|
||||
|
||||
sinclude .depend
|
||||
|
||||
#########################################################################
|
||||
153
common/package/boot/uboot-ipq40xx/src/httpd/fs.c
Normal file
153
common/package/boot/uboot-ipq40xx/src/httpd/fs.c
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
/**
|
||||
* \addtogroup httpd
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* HTTP server read-only file system code.
|
||||
* \author Adam Dunkels <adam@dunkels.com>
|
||||
*
|
||||
* A simple read-only filesystem.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE 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 is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: fs.c,v 1.7.2.3 2003/10/07 13:22:27 adam Exp $
|
||||
*/
|
||||
|
||||
#include "uip.h"
|
||||
#include "httpd.h"
|
||||
#include "fs.h"
|
||||
#include "fsdata.h"
|
||||
|
||||
#include "fsdata.c"
|
||||
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
static u16_t count[FS_NUMFILES];
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static u8_t
|
||||
fs_strcmp(const char *str1, const char *str2)
|
||||
{
|
||||
u8_t i;
|
||||
i = 0;
|
||||
loop:
|
||||
|
||||
if(str2[i] == 0 ||
|
||||
str1[i] == '\r' ||
|
||||
str1[i] == '\n') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(str1[i] != str2[i]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
++i;
|
||||
goto loop;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
int
|
||||
fs_open(const char *name, struct fs_file *file)
|
||||
{
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
u16_t i = 0;
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
struct fsdata_file_noconst *f;
|
||||
|
||||
for(f = (struct fsdata_file_noconst *)FS_ROOT;
|
||||
f != NULL;
|
||||
f = (struct fsdata_file_noconst *)f->next) {
|
||||
if(fs_strcmp(name, f->name) == 0) {
|
||||
file->data = f->data;
|
||||
file->len = f->len;
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
++count[i];
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
return 1;
|
||||
}
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
++i;
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
fs_init(void)
|
||||
{
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
u16_t i;
|
||||
for(i = 0; i < FS_NUMFILES; i++) {
|
||||
count[i] = 0;
|
||||
}
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
u16_t fs_count
|
||||
(char *name)
|
||||
{
|
||||
struct fsdata_file_noconst *f;
|
||||
u16_t i;
|
||||
|
||||
i = 0;
|
||||
for(f = (struct fsdata_file_noconst *)FS_ROOT;
|
||||
f != NULL;
|
||||
f = (struct fsdata_file_noconst *)f->next) {
|
||||
|
||||
if(fs_strcmp(name, f->name) == 0) {
|
||||
return count[i];
|
||||
}
|
||||
++i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
80
common/package/boot/uboot-ipq40xx/src/httpd/fs.h
Normal file
80
common/package/boot/uboot-ipq40xx/src/httpd/fs.h
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/**
|
||||
* \addtogroup httpd
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* HTTP server read-only file system header file.
|
||||
* \author Adam Dunkels <adam@dunkels.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE 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 is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: fs.h,v 1.6.2.3 2003/10/07 13:22:27 adam Exp $
|
||||
*/
|
||||
#ifndef __FS_H__
|
||||
#define __FS_H__
|
||||
|
||||
#include "uip.h"
|
||||
|
||||
/**
|
||||
* An open file in the read-only file system.
|
||||
*/
|
||||
struct fs_file {
|
||||
char *data; /**< The actual file data. */
|
||||
int len; /**< The length of the file data. */
|
||||
};
|
||||
|
||||
/**
|
||||
* Open a file in the read-only file system.
|
||||
*
|
||||
* \param name The name of the file.
|
||||
*
|
||||
* \param file The file pointer, which must be allocated by caller and
|
||||
* will be filled in by the function.
|
||||
*/
|
||||
int fs_open(const char *name, struct fs_file *file);
|
||||
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
u16_t fs_count(char *name);
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
|
||||
/**
|
||||
* Initialize the read-only file system.
|
||||
*/
|
||||
void fs_init(void);
|
||||
|
||||
#endif /* __FS_H__ */
|
||||
64
common/package/boot/uboot-ipq40xx/src/httpd/fsdata.h
Normal file
64
common/package/boot/uboot-ipq40xx/src/httpd/fsdata.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE 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 is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: fsdata.h,v 1.4.2.1 2003/10/04 22:54:06 adam Exp $
|
||||
*/
|
||||
#ifndef __FSDATA_H__
|
||||
#define __FSDATA_H__
|
||||
|
||||
#include "uipopt.h"
|
||||
|
||||
struct fsdata_file {
|
||||
const struct fsdata_file *next;
|
||||
const char *name;
|
||||
const char *data;
|
||||
const int len;
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
u16_t count;
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
};
|
||||
|
||||
struct fsdata_file_noconst {
|
||||
struct fsdata_file *next;
|
||||
char *name;
|
||||
char *data;
|
||||
int len;
|
||||
#ifdef FS_STATISTICS
|
||||
#if FS_STATISTICS == 1
|
||||
u16_t count;
|
||||
#endif /* FS_STATISTICS */
|
||||
#endif /* FS_STATISTICS */
|
||||
};
|
||||
|
||||
#endif /* __FSDATA_H__ */
|
||||
616
common/package/boot/uboot-ipq40xx/src/httpd/httpd.c
Normal file
616
common/package/boot/uboot-ipq40xx/src/httpd/httpd.c
Normal file
|
|
@ -0,0 +1,616 @@
|
|||
#include "uip.h"
|
||||
#include "httpd.h"
|
||||
#include "fs.h"
|
||||
#include "fsdata.h"
|
||||
|
||||
#define STATE_NONE 0 // empty state (waiting for request...)
|
||||
#define STATE_FILE_REQUEST 1 // remote host sent GET request
|
||||
#define STATE_UPLOAD_REQUEST 2 // remote host sent POST request
|
||||
|
||||
// ASCII characters
|
||||
#define ISO_G 0x47 // GET
|
||||
#define ISO_E 0x45
|
||||
#define ISO_T 0x54
|
||||
#define ISO_P 0x50 // POST
|
||||
#define ISO_O 0x4f
|
||||
#define ISO_S 0x53
|
||||
#define ISO_T 0x54
|
||||
#define ISO_slash 0x2f // control and other characters
|
||||
#define ISO_space 0x20
|
||||
#define ISO_nl 0x0a
|
||||
#define ISO_cr 0x0d
|
||||
#define ISO_tab 0x09
|
||||
|
||||
// we use this so that we can do without the ctype library
|
||||
#define is_digit(c) ((c) >= '0' && (c) <= '9')
|
||||
|
||||
// debug
|
||||
//#define DEBUG_UIP
|
||||
|
||||
// html files
|
||||
extern const struct fsdata_file file_index_html;
|
||||
extern const struct fsdata_file file_404_html;
|
||||
extern const struct fsdata_file file_flashing_html;
|
||||
extern const struct fsdata_file file_fail_html;
|
||||
|
||||
extern int webfailsafe_ready_for_upgrade;
|
||||
extern int webfailsafe_upgrade_type;
|
||||
extern ulong NetBootFileXferSize;
|
||||
extern unsigned char *webfailsafe_data_pointer;
|
||||
extern char led_flashing_flag;
|
||||
// http app state
|
||||
struct httpd_state *hs;
|
||||
u8_t appstate[UIP_APPSTATE_SIZE];
|
||||
|
||||
static int webfailsafe_post_done = 0;
|
||||
static int webfailsafe_upload_failed = 0;
|
||||
static int data_start_found = 0;
|
||||
static int small_file_flag = 0;
|
||||
|
||||
static unsigned char post_packet_counter = 0;
|
||||
|
||||
// 0x0D -> CR 0x0A -> LF
|
||||
static char eol[3] = { 0x0d, 0x0a, 0x00 };
|
||||
static char eol2[5] = { 0x0d, 0x0a, 0x0d, 0x0a, 0x00 };
|
||||
|
||||
static char *boundary_value = NULL;
|
||||
|
||||
// str to int
|
||||
int atoi(const char *s){
|
||||
int i = 0;
|
||||
|
||||
while(is_digit(*s)){
|
||||
i = i * 10 + *(s++) - '0';
|
||||
}
|
||||
|
||||
return(i);
|
||||
}
|
||||
|
||||
// print downloading progress
|
||||
static void httpd_download_progress(void){
|
||||
static char led_animation_counter = 0;
|
||||
if(post_packet_counter == 39){
|
||||
puts("\n ");
|
||||
post_packet_counter = 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SHIFT_REG
|
||||
check_timer_led();
|
||||
#endif
|
||||
|
||||
puts("#");
|
||||
post_packet_counter++;
|
||||
}
|
||||
|
||||
// http server init
|
||||
void httpd_init(void){
|
||||
fs_init();
|
||||
uip_listen(HTONS(80));
|
||||
}
|
||||
|
||||
// reset app state
|
||||
static void httpd_state_reset(void){
|
||||
hs->state = STATE_NONE;
|
||||
hs->count = 0;
|
||||
hs->dataptr = 0;
|
||||
hs->upload = 0;
|
||||
hs->upload_total = 0;
|
||||
|
||||
data_start_found = 0;
|
||||
post_packet_counter = 0;
|
||||
|
||||
if(boundary_value){
|
||||
free(boundary_value);
|
||||
boundary_value = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// find and get first chunk of data
|
||||
static int httpd_findandstore_firstchunk(void){
|
||||
char *start = NULL;
|
||||
char *end = NULL;
|
||||
|
||||
if(!boundary_value){
|
||||
return(0);
|
||||
}
|
||||
|
||||
// chek if we have data in packet
|
||||
start = (char *)strstr((char *)uip_appdata, (char *)boundary_value);
|
||||
|
||||
if(start){
|
||||
|
||||
// ok, we have data in this packet!
|
||||
// find upgrade type
|
||||
|
||||
end = (char *)strstr((char *)start, "name=\"firmware\"");
|
||||
|
||||
if(end){
|
||||
|
||||
printf("Upgrade type: firmware\n");
|
||||
webfailsafe_upgrade_type = WEBFAILSAFE_UPGRADE_TYPE_FIRMWARE;
|
||||
|
||||
} else {
|
||||
|
||||
end = (char *)strstr((char *)start, "name=\"uboot\"");
|
||||
|
||||
if(end){
|
||||
#if defined(WEBFAILSAFE_DISABLE_UBOOT_UPGRADE)
|
||||
printf_err("U-Boot upgrade is not allowed on this board!\n");
|
||||
webfailsafe_upload_failed = 1;
|
||||
#else
|
||||
webfailsafe_upgrade_type = WEBFAILSAFE_UPGRADE_TYPE_UBOOT;
|
||||
printf("Upgrade type: U-Boot\n");
|
||||
#endif /* if defined(WEBFAILSAFE_DISABLE_UBOOT_UPGRADE) */
|
||||
} else {
|
||||
|
||||
end = (char *)strstr((char *)start, "name=\"art\"");
|
||||
|
||||
if(end){
|
||||
#if defined(WEBFAILSAFE_DISABLE_ART_UPGRADE)
|
||||
printf_err("U-Boot upgrade is not allowed on this board!\n");
|
||||
webfailsafe_upload_failed = 1;
|
||||
#else
|
||||
printf("Upgrade type: ART\n");
|
||||
webfailsafe_upgrade_type = WEBFAILSAFE_UPGRADE_TYPE_ART;
|
||||
|
||||
// if we don't have ART partition offset, it means that it should be
|
||||
// stored on the last 64 KiB block -> in most supported board
|
||||
// the ART partition occupies last 64 KiB block
|
||||
#endif /* if defined(WEBFAILSAFE_DISABLE_ART_UPGRADE) */
|
||||
} else {
|
||||
|
||||
printf_err("input name not found!\n");
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
end = NULL;
|
||||
|
||||
// find start position of the data!
|
||||
end = (char *)strstr((char *)start, eol2);
|
||||
|
||||
if(end){
|
||||
|
||||
if((end - (char *)uip_appdata) < uip_len){
|
||||
|
||||
// move pointer over CR LF CR LF
|
||||
end += 4;
|
||||
|
||||
// how much data we expect?
|
||||
// last part (magic value 6): [CR][LF](boundary length)[-][-][CR][LF]
|
||||
hs->upload_total = hs->upload_total - (int)(end - start) - strlen(boundary_value) - 6;
|
||||
|
||||
printf("Upload file size: %d bytes\n", hs->upload_total);
|
||||
|
||||
// We need to check if file which we are going to download
|
||||
// has correct size (for every type of upgrade)
|
||||
|
||||
// U-Boot
|
||||
if((webfailsafe_upgrade_type == WEBFAILSAFE_UPGRADE_TYPE_UBOOT) && (hs->upload_total > CONFIG_MAX_UBOOT_SIZE)){
|
||||
|
||||
printf_err("file too big!\n");
|
||||
webfailsafe_upload_failed = 1;
|
||||
|
||||
// ART
|
||||
} else if((webfailsafe_upgrade_type == WEBFAILSAFE_UPGRADE_TYPE_ART) && (hs->upload_total != WEBFAILSAFE_UPLOAD_ART_SIZE_IN_BYTES)){
|
||||
|
||||
printf_err("wrong file size, should be: %d bytes!\n", WEBFAILSAFE_UPLOAD_ART_SIZE_IN_BYTES);
|
||||
webfailsafe_upload_failed = 1;
|
||||
|
||||
// firmware can't exceed: (FLASH_SIZE - WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES)
|
||||
}else if(hs->upload_total > WEBFAILSAFE_UPLOAD_FW_SIZE_IN_BYTES){
|
||||
|
||||
printf_err("file too big!\n");
|
||||
webfailsafe_upload_failed = 1;
|
||||
|
||||
}
|
||||
|
||||
printf("Loading: ");
|
||||
|
||||
// how much data we are storing now?
|
||||
hs->upload = (unsigned int)(uip_len - (end - (char *)uip_appdata));
|
||||
|
||||
memcpy((void *)webfailsafe_data_pointer, (void *)end, hs->upload);
|
||||
webfailsafe_data_pointer += hs->upload;
|
||||
|
||||
httpd_download_progress();
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
} else {
|
||||
printf_err("couldn't find start of data!\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
// called for http server app
|
||||
void httpd_appcall(void){
|
||||
struct fs_file fsfile;
|
||||
unsigned int i;
|
||||
|
||||
switch(uip_conn->lport){
|
||||
|
||||
case HTONS(80):
|
||||
|
||||
// app state
|
||||
hs = (struct httpd_state *)(appstate);
|
||||
|
||||
// closed connection
|
||||
if(uip_closed()){
|
||||
httpd_state_reset();
|
||||
uip_close();
|
||||
return;
|
||||
}
|
||||
|
||||
// aborted connection or time out occured
|
||||
if(uip_aborted() || uip_timedout()){
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
}
|
||||
|
||||
// if we are pooled
|
||||
if(uip_poll()){
|
||||
if(hs->count++ >= 100){
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// new connection
|
||||
if(uip_connected()){
|
||||
httpd_state_reset();
|
||||
return;
|
||||
}
|
||||
|
||||
// new data in STATE_NONE
|
||||
if(uip_newdata() && hs->state == STATE_NONE){
|
||||
|
||||
// GET or POST request?
|
||||
if(uip_appdata[0] == ISO_G && uip_appdata[1] == ISO_E && uip_appdata[2] == ISO_T && (uip_appdata[3] == ISO_space || uip_appdata[3] == ISO_tab)){
|
||||
hs->state = STATE_FILE_REQUEST;
|
||||
} else if(uip_appdata[0] == ISO_P && uip_appdata[1] == ISO_O && uip_appdata[2] == ISO_S && uip_appdata[3] == ISO_T && (uip_appdata[4] == ISO_space || uip_appdata[4] == ISO_tab)){
|
||||
hs->state = STATE_UPLOAD_REQUEST;
|
||||
}
|
||||
|
||||
// anything else -> abort the connection!
|
||||
if(hs->state == STATE_NONE){
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
}
|
||||
|
||||
// get file or firmware upload?
|
||||
if(hs->state == STATE_FILE_REQUEST){
|
||||
|
||||
// we are looking for GET file name
|
||||
for(i = 4; i < 30; i++){
|
||||
if(uip_appdata[i] == ISO_space || uip_appdata[i] == ISO_cr || uip_appdata[i] == ISO_nl || uip_appdata[i] == ISO_tab){
|
||||
uip_appdata[i] = 0;
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(i != 0){
|
||||
printf_err("request file name too long!\n");
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Request for: ");
|
||||
printf("%s\n", &uip_appdata[4]);
|
||||
|
||||
// request for /
|
||||
if(uip_appdata[4] == ISO_slash && uip_appdata[5] == 0){
|
||||
fs_open(file_index_html.name, &fsfile);
|
||||
} else {
|
||||
// check if we have requested file
|
||||
if(!fs_open((const char *)&uip_appdata[4], &fsfile)){
|
||||
printf_err("file not found!\n");
|
||||
fs_open(file_404_html.name, &fsfile);
|
||||
}
|
||||
}
|
||||
|
||||
hs->state = STATE_FILE_REQUEST;
|
||||
hs->dataptr = (u8_t *)fsfile.data;
|
||||
hs->upload = fsfile.len;
|
||||
|
||||
// send first (and maybe the last) chunk of data
|
||||
uip_send(hs->dataptr, (hs->upload > uip_mss() ? uip_mss() : hs->upload));
|
||||
return;
|
||||
|
||||
} else if(hs->state == STATE_UPLOAD_REQUEST){
|
||||
|
||||
char *start = NULL;
|
||||
char *end = NULL;
|
||||
|
||||
// end bufor data with NULL
|
||||
uip_appdata[uip_len] = '\0';
|
||||
|
||||
/*
|
||||
* We got first packet with POST request
|
||||
*
|
||||
* Some browsers don't include first chunk of data in the first
|
||||
* POST request packet (like Google Chrome, IE and Safari)!
|
||||
* So we must now find two values:
|
||||
* - Content-Length
|
||||
* - boundary
|
||||
* Headers with these values can be in any order!
|
||||
* If we don't find these values in first packet, connection will be aborted!
|
||||
*
|
||||
*/
|
||||
|
||||
// Content-Length pos
|
||||
start = (char *)strstr((char*)uip_appdata, "Content-Length:");
|
||||
|
||||
if(start){
|
||||
|
||||
start += sizeof("Content-Length:");
|
||||
|
||||
// find end of the line with "Content-Length:"
|
||||
end = (char *)strstr(start, eol);
|
||||
|
||||
if(end){
|
||||
|
||||
hs->upload_total = atoi(start);
|
||||
#ifdef DEBUG_UIP
|
||||
printf("Expecting %d bytes in body request message\n", hs->upload_total);
|
||||
#endif
|
||||
|
||||
} else {
|
||||
printf_err("couldn't find 'Content-Length'!\n");
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
printf_err("couldn't find 'Content-Length'!\n");
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
}
|
||||
|
||||
/* we don't support very small files (< 10 KB) */
|
||||
if(hs->upload_total < 10240){
|
||||
small_file_flag = 1;
|
||||
}
|
||||
|
||||
// boundary value
|
||||
start = NULL;
|
||||
end = NULL;
|
||||
|
||||
start = (char *)strstr((char *)uip_appdata, "boundary=");
|
||||
|
||||
if(start){
|
||||
|
||||
// move pointer over "boundary="
|
||||
start += 9;
|
||||
|
||||
// find end of line with boundary value
|
||||
end = (char *)strstr((char *)start, eol);
|
||||
|
||||
if(end){
|
||||
|
||||
// malloc space for boundary value + '--' and '\0'
|
||||
boundary_value = (char*)malloc(end - start + 3);
|
||||
|
||||
if(boundary_value){
|
||||
|
||||
memcpy(&boundary_value[2], start, end - start);
|
||||
|
||||
// add -- at the begin and 0 at the end
|
||||
boundary_value[0] = '-';
|
||||
boundary_value[1] = '-';
|
||||
boundary_value[end - start + 2] = 0;
|
||||
|
||||
#ifdef DEBUG_UIP
|
||||
printf("Found boundary value: \"%s\"\n", boundary_value);
|
||||
#endif
|
||||
|
||||
} else {
|
||||
printf_err("couldn't allocate memory for boundary!\n");
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
printf_err("couldn't find boundary!\n");
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
printf_err("couldn't find boundary!\n");
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* OK, if we are here, it means that we found
|
||||
* Content-Length and boundary values in headers
|
||||
*
|
||||
* We can now try to 'allocate memory' and
|
||||
* find beginning of the data in first packet
|
||||
*/
|
||||
|
||||
webfailsafe_data_pointer = (u8_t *)CONFIG_LOADADDR;
|
||||
|
||||
if(!webfailsafe_data_pointer){
|
||||
printf_err("couldn't allocate RAM for data!\n");
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
} else {
|
||||
printf("Data will be downloaded at 0x%X in RAM\n", CONFIG_LOADADDR);
|
||||
led_flashing_flag = 1;
|
||||
}
|
||||
|
||||
memset((void *)webfailsafe_data_pointer, 0xFF, CONFIG_MAX_UBOOT_SIZE);
|
||||
|
||||
if(httpd_findandstore_firstchunk()){
|
||||
data_start_found = 1;
|
||||
} else {
|
||||
data_start_found = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
} /* else if(hs->state == STATE_UPLOAD_REQUEST) */
|
||||
|
||||
} /* uip_newdata() && hs->state == STATE_NONE */
|
||||
|
||||
// if we got ACK from remote host
|
||||
if(uip_acked()){
|
||||
|
||||
// if we are in STATE_FILE_REQUEST state
|
||||
if(hs->state == STATE_FILE_REQUEST){
|
||||
|
||||
// data which we send last time was received (we got ACK)
|
||||
// if we send everything last time -> gently close the connection
|
||||
if(hs->upload <= uip_mss()){
|
||||
|
||||
// post upload completed?
|
||||
if(webfailsafe_post_done){
|
||||
|
||||
if(!webfailsafe_upload_failed){
|
||||
webfailsafe_ready_for_upgrade = 1;
|
||||
}
|
||||
|
||||
webfailsafe_post_done = 0;
|
||||
webfailsafe_upload_failed = 0;
|
||||
}
|
||||
|
||||
httpd_state_reset();
|
||||
uip_close();
|
||||
return;
|
||||
}
|
||||
|
||||
// otherwise, send another chunk of data
|
||||
// last time we sent uip_conn->len size of data
|
||||
hs->dataptr += uip_conn->len;
|
||||
hs->upload -= uip_conn->len;
|
||||
|
||||
uip_send(hs->dataptr, (hs->upload > uip_mss() ? uip_mss() : hs->upload));
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// if we need to retransmit
|
||||
if(uip_rexmit()){
|
||||
|
||||
// if we are in STATE_FILE_REQUEST state
|
||||
if(hs->state == STATE_FILE_REQUEST){
|
||||
// send again chunk of data without changing pointer and length of data left to send
|
||||
uip_send(hs->dataptr, (hs->upload > uip_mss() ? uip_mss() : hs->upload));
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// if we got new data frome remote host
|
||||
if(uip_newdata()){
|
||||
|
||||
// if we are in STATE_UPLOAD_REQUEST state
|
||||
if(hs->state == STATE_UPLOAD_REQUEST){
|
||||
|
||||
// end bufor data with NULL
|
||||
uip_appdata[uip_len] = '\0';
|
||||
|
||||
// do we have to find start of data?
|
||||
/* Skip for small files < 10 KB's*/
|
||||
if(!small_file_flag){
|
||||
if(!data_start_found){
|
||||
if(!httpd_findandstore_firstchunk()){
|
||||
printf_err("couldn't find start of data in next packet!\n");
|
||||
httpd_state_reset();
|
||||
uip_abort();
|
||||
return;
|
||||
} else {
|
||||
data_start_found = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
hs->upload += (unsigned int)uip_len;
|
||||
|
||||
if(!webfailsafe_upload_failed){
|
||||
memcpy((void *)webfailsafe_data_pointer, (void *)uip_appdata, uip_len);
|
||||
webfailsafe_data_pointer += uip_len;
|
||||
}
|
||||
|
||||
httpd_download_progress();
|
||||
|
||||
// if we have collected all data
|
||||
// Add boundary value and magic packet(+6) to total upload value
|
||||
// Incase last packet consists of only boundary value and magic packet(+6)
|
||||
if(hs->upload >= (hs->upload_total + strlen(boundary_value) + 6)){
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
// end of post upload
|
||||
webfailsafe_post_done = 1;
|
||||
NetBootFileXferSize = (ulong)hs->upload_total;
|
||||
|
||||
|
||||
// which website will be returned
|
||||
if(!webfailsafe_upload_failed){
|
||||
if ((webfailsafe_upgrade_type == WEBFAILSAFE_UPGRADE_TYPE_FIRMWARE) &&
|
||||
(fwtool_validate_manifest((void *)CONFIG_LOADADDR, hs->upload_total))) {
|
||||
webfailsafe_upload_failed = 1;
|
||||
printf_err("Firmware validation fail!\n");
|
||||
}
|
||||
}
|
||||
|
||||
if(!webfailsafe_upload_failed){
|
||||
fs_open(file_flashing_html.name, &fsfile);
|
||||
} else {
|
||||
fs_open(file_fail_html.name, &fsfile);
|
||||
}
|
||||
|
||||
/* Reset small file flag for future uploads */
|
||||
if(small_file_flag){
|
||||
small_file_flag = 0;
|
||||
}
|
||||
|
||||
httpd_state_reset();
|
||||
|
||||
hs->state = STATE_FILE_REQUEST;
|
||||
hs->dataptr = (u8_t *)fsfile.data;
|
||||
hs->upload = fsfile.len;
|
||||
|
||||
uip_send(hs->dataptr, (hs->upload > uip_mss() ? uip_mss() : hs->upload));
|
||||
led_flashing_flag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
// we shouldn't get here... we are listening only on port 80
|
||||
uip_abort();
|
||||
break;
|
||||
}
|
||||
}
|
||||
77
common/package/boot/uboot-ipq40xx/src/httpd/httpd.h
Normal file
77
common/package/boot/uboot-ipq40xx/src/httpd/httpd.h
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/**
|
||||
* \addtogroup httpd
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* HTTP server header file.
|
||||
* \author Adam Dunkels <adam@dunkels.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 is part of the uIP TCP/IP stack.
|
||||
*
|
||||
* $Id: httpd.h,v 1.4.2.3 2003/10/06 22:56:44 adam Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __HTTPD_H__
|
||||
#define __HTTPD_H__
|
||||
|
||||
void httpd_init(void);
|
||||
void httpd_appcall(void);
|
||||
|
||||
/* UIP_APPCALL: the name of the application function. This function
|
||||
must return void and take no arguments (i.e., C type "void
|
||||
appfunc(void)"). */
|
||||
#ifndef UIP_APPCALL
|
||||
#define UIP_APPCALL httpd_appcall
|
||||
#endif
|
||||
|
||||
struct httpd_state {
|
||||
u8_t state;
|
||||
u16_t count;
|
||||
u8_t *dataptr;
|
||||
unsigned int upload;
|
||||
unsigned int upload_total;
|
||||
};
|
||||
|
||||
/* UIP_APPSTATE_SIZE: The size of the application-specific state
|
||||
stored in the uip_conn structure. */
|
||||
#ifndef UIP_APPSTATE_SIZE
|
||||
#define UIP_APPSTATE_SIZE (sizeof(struct httpd_state))
|
||||
#endif
|
||||
|
||||
//#define FS_STATISTICS 1
|
||||
|
||||
extern struct httpd_state *hs;
|
||||
|
||||
#endif /* __HTTPD_H__ */
|
||||
88
common/package/boot/uboot-ipq40xx/src/httpd/main.c
Normal file
88
common/package/boot/uboot-ipq40xx/src/httpd/main.c
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* Copyright (c) 2001-2003, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 is part of the uIP TCP/IP stack.
|
||||
*
|
||||
* $Id: main.c,v 1.10.2.1 2003/10/04 22:54:17 adam Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "uip.h"
|
||||
#include "uip_arp.h"
|
||||
#include "tapdev.h"
|
||||
#include "httpd.h"
|
||||
|
||||
#define BUF ((struct uip_eth_hdr *)&uip_buf[0])
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void *)0
|
||||
#endif /* NULL */
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
u8_t i, arptimer;
|
||||
tapdev_init();
|
||||
uip_init();
|
||||
httpd_init();
|
||||
arptimer = 0;
|
||||
while(1) {
|
||||
uip_len = tapdev_read();
|
||||
if(uip_len == 0) {
|
||||
for(i = 0; i < UIP_CONNS; i++) {
|
||||
uip_periodic(i);
|
||||
if(uip_len > 0) {
|
||||
uip_arp_out();
|
||||
tapdev_send();
|
||||
}
|
||||
}
|
||||
|
||||
if(++arptimer == 20) {
|
||||
uip_arp_timer();
|
||||
arptimer = 0;
|
||||
}
|
||||
} else {
|
||||
if(BUF->type == htons(UIP_ETHTYPE_IP)) {
|
||||
uip_arp_ipin();
|
||||
uip_input();
|
||||
if(uip_len > 0) {
|
||||
uip_arp_out();
|
||||
tapdev_send();
|
||||
}
|
||||
} else if(BUF->type == htons(UIP_ETHTYPE_ARP)) {
|
||||
uip_arp_arpin();
|
||||
if(uip_len > 0) {
|
||||
tapdev_send();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
192
common/package/boot/uboot-ipq40xx/src/httpd/tapdev.c
Normal file
192
common/package/boot/uboot-ipq40xx/src/httpd/tapdev.c
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
/*
|
||||
* Copyright (c) 2001, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE 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.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: tapdev.c,v 1.7.2.1 2003/10/07 13:23:19 adam Exp $
|
||||
*/
|
||||
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#ifdef linux
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_tun.h>
|
||||
#define DEVTAP "/dev/net/tun"
|
||||
#else /* linux */
|
||||
#define DEVTAP "/dev/tap0"
|
||||
#endif /* linux */
|
||||
|
||||
#include "uip.h"
|
||||
|
||||
static int fd;
|
||||
|
||||
static unsigned long lasttime;
|
||||
static struct timezone tz;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
tapdev_init(void)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
fd = open(DEVTAP, O_RDWR);
|
||||
if(fd == -1) {
|
||||
perror("tapdev: tapdev_init: open");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef linux
|
||||
{
|
||||
struct ifreq ifr;
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
|
||||
if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) {
|
||||
perror(buf);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
#endif /* Linux */
|
||||
|
||||
snprintf(buf, sizeof(buf), "ifconfig tap0 inet %d.%d.%d.%d",
|
||||
UIP_DRIPADDR0, UIP_DRIPADDR1, UIP_DRIPADDR2, UIP_DRIPADDR3);
|
||||
system(buf);
|
||||
|
||||
lasttime = 0;
|
||||
}
|
||||
|
||||
void dump_mem(int type, int len)
|
||||
{
|
||||
#if DUMP == 1
|
||||
int i;
|
||||
for(i = 0; i < len; i++)
|
||||
printf("%c", uip_buf[i]);
|
||||
if(type)
|
||||
{
|
||||
printf("\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01");
|
||||
printf("\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01");
|
||||
} else {
|
||||
printf("\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02");
|
||||
printf("\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02");
|
||||
}
|
||||
fflush(stdout);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
unsigned int
|
||||
tapdev_read(void)
|
||||
{
|
||||
fd_set fdset;
|
||||
struct timeval tv, now;
|
||||
int ret;
|
||||
|
||||
if(lasttime >= 500000) {
|
||||
lasttime = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 500000 - lasttime;
|
||||
|
||||
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(fd, &fdset);
|
||||
|
||||
gettimeofday(&now, &tz);
|
||||
ret = select(fd + 1, &fdset, NULL, NULL, &tv);
|
||||
if(ret == 0) {
|
||||
lasttime = 0;
|
||||
return 0;
|
||||
}
|
||||
ret = read(fd, uip_buf, UIP_BUFSIZE);
|
||||
if(ret == -1) {
|
||||
perror("tap_dev: tapdev_read: read");
|
||||
}
|
||||
gettimeofday(&tv, &tz);
|
||||
lasttime += (tv.tv_sec - now.tv_sec) * 1000000 + (tv.tv_usec - now.tv_usec);
|
||||
dump_mem(0, ret);
|
||||
return ret;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
tapdev_send(void)
|
||||
{
|
||||
int ret;
|
||||
struct iovec iov[2];
|
||||
|
||||
#ifdef linux
|
||||
{
|
||||
char tmpbuf[UIP_BUFSIZE];
|
||||
int i;
|
||||
|
||||
for(i = 0; i < 40 + UIP_LLH_LEN; i++) {
|
||||
tmpbuf[i] = uip_buf[i];
|
||||
}
|
||||
|
||||
for(; i < uip_len; i++) {
|
||||
tmpbuf[i] = uip_appdata[i - 40 - UIP_LLH_LEN];
|
||||
}
|
||||
|
||||
ret = write(fd, tmpbuf, uip_len);
|
||||
}
|
||||
#else
|
||||
|
||||
if(uip_len < 40 + UIP_LLH_LEN) {
|
||||
ret = write(fd, uip_buf, uip_len + UIP_LLH_LEN);
|
||||
} else {
|
||||
iov[0].iov_base = uip_buf;
|
||||
iov[0].iov_len = 40 + UIP_LLH_LEN;
|
||||
iov[1].iov_base = (char *)uip_appdata;
|
||||
iov[1].iov_len = uip_len - (40 + UIP_LLH_LEN);
|
||||
|
||||
ret = writev(fd, iov, 2);
|
||||
}
|
||||
#endif
|
||||
dump_mem(1, ret);
|
||||
|
||||
if(ret == -1) {
|
||||
perror("tap_dev: tapdev_send: writev");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
42
common/package/boot/uboot-ipq40xx/src/httpd/tapdev.h
Normal file
42
common/package/boot/uboot-ipq40xx/src/httpd/tapdev.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) 2001, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 is part of the uIP TCP/IP stack.
|
||||
*
|
||||
* $Id: tapdev.h,v 1.1.2.1 2003/10/04 22:54:17 adam Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TAPDEV_H__
|
||||
#define __TAPDEV_H__
|
||||
|
||||
void tapdev_init(void);
|
||||
unsigned int tapdev_read(void);
|
||||
void tapdev_send(void);
|
||||
|
||||
#endif /* __TAPDEV_H__ */
|
||||
1503
common/package/boot/uboot-ipq40xx/src/httpd/uip.c
Normal file
1503
common/package/boot/uboot-ipq40xx/src/httpd/uip.c
Normal file
File diff suppressed because it is too large
Load diff
1066
common/package/boot/uboot-ipq40xx/src/httpd/uip.h
Executable file
1066
common/package/boot/uboot-ipq40xx/src/httpd/uip.h
Executable file
File diff suppressed because it is too large
Load diff
157
common/package/boot/uboot-ipq40xx/src/httpd/uip_arch.c
Executable file
157
common/package/boot/uboot-ipq40xx/src/httpd/uip_arch.c
Executable file
|
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
* Copyright (c) 2001, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 is part of the uIP TCP/IP stack.
|
||||
*
|
||||
* $Id: uip_arch.c,v 1.2.2.1 2003/10/04 22:54:17 adam Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "uip.h"
|
||||
#include "uip_arch.h"
|
||||
|
||||
#define BUF ((uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
|
||||
#define IP_PROTO_TCP 6
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_add32(u8_t *op32, u16_t op16)
|
||||
{
|
||||
|
||||
uip_acc32[3] = op32[3] + (op16 & 0xff);
|
||||
uip_acc32[2] = op32[2] + (op16 >> 8);
|
||||
uip_acc32[1] = op32[1];
|
||||
uip_acc32[0] = op32[0];
|
||||
|
||||
if(uip_acc32[2] < (op16 >> 8)) {
|
||||
++uip_acc32[1];
|
||||
if(uip_acc32[1] == 0) {
|
||||
++uip_acc32[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(uip_acc32[3] < (op16 & 0xff)) {
|
||||
++uip_acc32[2];
|
||||
if(uip_acc32[2] == 0) {
|
||||
++uip_acc32[1];
|
||||
if(uip_acc32[1] == 0) {
|
||||
++uip_acc32[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
u16_t
|
||||
chksum(u16_t sum, const u8_t *data, u16_t len)
|
||||
{
|
||||
u16_t t;
|
||||
const u8_t *dataptr;
|
||||
const u8_t *last_byte;
|
||||
|
||||
dataptr = data;
|
||||
last_byte = data + len - 1;
|
||||
|
||||
while(dataptr < last_byte) { /* At least two more bytes */
|
||||
t = (dataptr[0] << 8) + dataptr[1];
|
||||
sum += t;
|
||||
if(sum < t) {
|
||||
sum++; /* carry */
|
||||
}
|
||||
dataptr += 2;
|
||||
}
|
||||
|
||||
if(dataptr == last_byte) {
|
||||
t = (dataptr[0] << 8) + 0;
|
||||
sum += t;
|
||||
if(sum < t) {
|
||||
sum++; /* carry */
|
||||
}
|
||||
}
|
||||
|
||||
/* Return sum in host byte order. */
|
||||
return sum;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
u16_t
|
||||
uip_chksum(u16_t *data, u16_t len)
|
||||
{
|
||||
return htons(chksum(0, (u8_t *)data, len));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
u16_t
|
||||
uip_ipchksum(void)
|
||||
{
|
||||
return uip_chksum((u16_t *)&uip_buf[UIP_LLH_LEN], 20);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
u16_t
|
||||
uip_tcpchksum(void)
|
||||
{
|
||||
u16_t hsum, sum;
|
||||
|
||||
|
||||
/* Compute the checksum of the TCP header. */
|
||||
hsum = uip_chksum((u16_t *)&uip_buf[20 + UIP_LLH_LEN], 20);
|
||||
|
||||
/* Compute the checksum of the data in the TCP packet and add it to
|
||||
the TCP header checksum. */
|
||||
sum = uip_chksum((u16_t *)uip_appdata,
|
||||
(u16_t)(((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 40)));
|
||||
|
||||
if((sum += hsum) < hsum) {
|
||||
++sum;
|
||||
}
|
||||
|
||||
if((sum += BUF->srcipaddr[0]) < BUF->srcipaddr[0]) {
|
||||
++sum;
|
||||
}
|
||||
if((sum += BUF->srcipaddr[1]) < BUF->srcipaddr[1]) {
|
||||
++sum;
|
||||
}
|
||||
if((sum += BUF->destipaddr[0]) < BUF->destipaddr[0]) {
|
||||
++sum;
|
||||
}
|
||||
if((sum += BUF->destipaddr[1]) < BUF->destipaddr[1]) {
|
||||
++sum;
|
||||
}
|
||||
if((sum += (u16_t)htons((u16_t)IP_PROTO_TCP)) < (u16_t)htons((u16_t)IP_PROTO_TCP)) {
|
||||
++sum;
|
||||
}
|
||||
|
||||
hsum = (u16_t)htons((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 20);
|
||||
|
||||
if((sum += hsum) < hsum) {
|
||||
++sum;
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
130
common/package/boot/uboot-ipq40xx/src/httpd/uip_arch.h
Normal file
130
common/package/boot/uboot-ipq40xx/src/httpd/uip_arch.h
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
/**
|
||||
* \defgroup uiparch Architecture specific uIP functions
|
||||
* @{
|
||||
*
|
||||
* The functions in the architecture specific module implement the IP
|
||||
* check sum and 32-bit additions.
|
||||
*
|
||||
* The IP checksum calculation is the most computationally expensive
|
||||
* operation in the TCP/IP stack and it therefore pays off to
|
||||
* implement this in efficient assembler. The purpose of the uip-arch
|
||||
* module is to let the checksum functions to be implemented in
|
||||
* architecture specific assembler.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Declarations of architecture specific functions.
|
||||
* \author Adam Dunkels <adam@dunkels.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 is part of the uIP TCP/IP stack.
|
||||
*
|
||||
* $Id: uip_arch.h,v 1.1.2.2 2003/10/06 15:10:22 adam Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __UIP_ARCH_H__
|
||||
#define __UIP_ARCH_H__
|
||||
|
||||
#include "uip.h"
|
||||
|
||||
/**
|
||||
* Carry out a 32-bit addition.
|
||||
*
|
||||
* Because not all architectures for which uIP is intended has native
|
||||
* 32-bit arithmetic, uIP uses an external C function for doing the
|
||||
* required 32-bit additions in the TCP protocol processing. This
|
||||
* function should add the two arguments and place the result in the
|
||||
* global variable uip_acc32.
|
||||
*
|
||||
* \note The 32-bit integer pointed to by the op32 parameter and the
|
||||
* result in the uip_acc32 variable are in network byte order (big
|
||||
* endian).
|
||||
*
|
||||
* \param op32 A pointer to a 4-byte array representing a 32-bit
|
||||
* integer in network byte order (big endian).
|
||||
*
|
||||
* \param op16 A 16-bit integer in host byte order.
|
||||
*/
|
||||
void uip_add32(u8_t *op32, u16_t op16);
|
||||
|
||||
/**
|
||||
* Calculate the Internet checksum over a buffer.
|
||||
*
|
||||
* The Internet checksum is the one's complement of the one's
|
||||
* complement sum of all 16-bit words in the buffer.
|
||||
*
|
||||
* See RFC1071.
|
||||
*
|
||||
* \note This function is not called in the current version of uIP,
|
||||
* but future versions might make use of it.
|
||||
*
|
||||
* \param buf A pointer to the buffer over which the checksum is to be
|
||||
* computed.
|
||||
*
|
||||
* \param len The length of the buffer over which the checksum is to
|
||||
* be computed.
|
||||
*
|
||||
* \return The Internet checksum of the buffer.
|
||||
*/
|
||||
u16_t uip_chksum(u16_t *buf, u16_t len);
|
||||
|
||||
/**
|
||||
* Calculate the IP header checksum of the packet header in uip_buf.
|
||||
*
|
||||
* The IP header checksum is the Internet checksum of the 20 bytes of
|
||||
* the IP header.
|
||||
*
|
||||
* \return The IP header checksum of the IP header in the uip_buf
|
||||
* buffer.
|
||||
*/
|
||||
u16_t uip_ipchksum(void);
|
||||
|
||||
/**
|
||||
* Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
|
||||
*
|
||||
* The TCP checksum is the Internet checksum of data contents of the
|
||||
* TCP segment, and a pseudo-header as defined in RFC793.
|
||||
*
|
||||
* \note The uip_appdata pointer that points to the packet data may
|
||||
* point anywhere in memory, so it is not possible to simply calculate
|
||||
* the Internet checksum of the contents of the uip_buf buffer.
|
||||
*
|
||||
* \return The TCP checksum of the TCP segment in uip_buf and pointed
|
||||
* to by uip_appdata.
|
||||
*/
|
||||
u16_t uip_tcpchksum(void);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* __UIP_ARCH_H__ */
|
||||
421
common/package/boot/uboot-ipq40xx/src/httpd/uip_arp.c
Normal file
421
common/package/boot/uboot-ipq40xx/src/httpd/uip_arp.c
Normal file
|
|
@ -0,0 +1,421 @@
|
|||
/**
|
||||
* \addtogroup uip
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup uiparp uIP Address Resolution Protocol
|
||||
* @{
|
||||
*
|
||||
* The Address Resolution Protocol ARP is used for mapping between IP
|
||||
* addresses and link level addresses such as the Ethernet MAC
|
||||
* addresses. ARP uses broadcast queries to ask for the link level
|
||||
* address of a known IP address and the host which is configured with
|
||||
* the IP address for which the query was meant, will respond with its
|
||||
* link level address.
|
||||
*
|
||||
* \note This ARP implementation only supports Ethernet.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Implementation of the ARP Address Resolution Protocol.
|
||||
* \author Adam Dunkels <adam@dunkels.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2003, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 is part of the uIP TCP/IP stack.
|
||||
*
|
||||
* $Id: uip_arp.c,v 1.7.2.3 2003/10/06 22:42:30 adam Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "uip_arp.h"
|
||||
|
||||
struct arp_hdr_httpd {
|
||||
struct uip_eth_hdr ethhdr;
|
||||
u16_t hwtype;
|
||||
u16_t protocol;
|
||||
u8_t hwlen;
|
||||
u8_t protolen;
|
||||
u16_t opcode;
|
||||
struct uip_eth_addr shwaddr;
|
||||
u16_t sipaddr[2];
|
||||
struct uip_eth_addr dhwaddr;
|
||||
u16_t dipaddr[2];
|
||||
};
|
||||
|
||||
struct ethip_hdr {
|
||||
struct uip_eth_hdr ethhdr;
|
||||
/* IP header. */
|
||||
u8_t vhl,
|
||||
tos,
|
||||
len[2],
|
||||
ipid[2],
|
||||
ipoffset[2],
|
||||
ttl,
|
||||
proto;
|
||||
u16_t ipchksum;
|
||||
u16_t srcipaddr[2],
|
||||
destipaddr[2];
|
||||
};
|
||||
|
||||
#define ARP_REQUEST 1
|
||||
#define ARP_REPLY 2
|
||||
|
||||
#define ARP_HWTYPE_ETH 1
|
||||
|
||||
struct arp_entry {
|
||||
u16_t ipaddr[2];
|
||||
struct uip_eth_addr ethaddr;
|
||||
u8_t time;
|
||||
};
|
||||
|
||||
struct uip_eth_addr uip_ethaddr = {{UIP_ETHADDR0,
|
||||
UIP_ETHADDR1,
|
||||
UIP_ETHADDR2,
|
||||
UIP_ETHADDR3,
|
||||
UIP_ETHADDR4,
|
||||
UIP_ETHADDR5}};
|
||||
|
||||
static struct arp_entry arp_table[UIP_ARPTAB_SIZE];
|
||||
static u16_t ipaddr[2];
|
||||
static u8_t i, c;
|
||||
|
||||
static u8_t arptime;
|
||||
static u8_t tmpage;
|
||||
|
||||
#define BUF ((struct arp_hdr_httpd *)&uip_buf[0])
|
||||
#define IPBUF ((struct ethip_hdr *)&uip_buf[0])
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Initialize the ARP module.
|
||||
*
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_arp_init(void)
|
||||
{
|
||||
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
|
||||
memset(arp_table[i].ipaddr, 0, 4);
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Periodic ARP processing function.
|
||||
*
|
||||
* This function performs periodic timer processing in the ARP module
|
||||
* and should be called at regular intervals. The recommended interval
|
||||
* is 10 seconds between the calls.
|
||||
*
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_arp_timer(void)
|
||||
{
|
||||
struct arp_entry *tabptr;
|
||||
|
||||
++arptime;
|
||||
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
|
||||
tabptr = &arp_table[i];
|
||||
if((tabptr->ipaddr[0] | tabptr->ipaddr[1]) != 0 &&
|
||||
arptime - tabptr->time >= UIP_ARP_MAXAGE) {
|
||||
memset(tabptr->ipaddr, 0, 4);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static void
|
||||
uip_arp_update(u16_t *ipaddr, struct uip_eth_addr *ethaddr)
|
||||
{
|
||||
register struct arp_entry *tabptr = 0;
|
||||
/* Walk through the ARP mapping table and try to find an entry to
|
||||
update. If none is found, the IP -> MAC address mapping is
|
||||
inserted in the ARP table. */
|
||||
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
|
||||
|
||||
tabptr = &arp_table[i];
|
||||
/* Only check those entries that are actually in use. */
|
||||
if(tabptr->ipaddr[0] != 0 &&
|
||||
tabptr->ipaddr[1] != 0) {
|
||||
|
||||
/* Check if the source IP address of the incoming packet matches
|
||||
the IP address in this ARP table entry. */
|
||||
if(ipaddr[0] == tabptr->ipaddr[0] &&
|
||||
ipaddr[1] == tabptr->ipaddr[1]) {
|
||||
|
||||
/* An old entry found, update this and return. */
|
||||
memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6);
|
||||
tabptr->time = arptime;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If we get here, no existing ARP table entry was found, so we
|
||||
create one. */
|
||||
|
||||
/* First, we try to find an unused entry in the ARP table. */
|
||||
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
|
||||
tabptr = &arp_table[i];
|
||||
if(tabptr->ipaddr[0] == 0 &&
|
||||
tabptr->ipaddr[1] == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If no unused entry is found, we try to find the oldest entry and
|
||||
throw it away. */
|
||||
if(i == UIP_ARPTAB_SIZE) {
|
||||
tmpage = 0;
|
||||
c = 0;
|
||||
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
|
||||
tabptr = &arp_table[i];
|
||||
if(arptime - tabptr->time > tmpage) {
|
||||
tmpage = arptime - tabptr->time;
|
||||
c = i;
|
||||
}
|
||||
}
|
||||
i = c;
|
||||
}
|
||||
|
||||
/* Now, i is the ARP table entry which we will fill with the new
|
||||
information. */
|
||||
memcpy(tabptr->ipaddr, ipaddr, 4);
|
||||
memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6);
|
||||
tabptr->time = arptime;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* ARP processing for incoming IP packets
|
||||
*
|
||||
* This function should be called by the device driver when an IP
|
||||
* packet has been received. The function will check if the address is
|
||||
* in the ARP cache, and if so the ARP cache entry will be
|
||||
* refreshed. If no ARP cache entry was found, a new one is created.
|
||||
*
|
||||
* This function expects an IP packet with a prepended Ethernet header
|
||||
* in the uip_buf[] buffer, and the length of the packet in the global
|
||||
* variable uip_len.
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_arp_ipin(void)
|
||||
{
|
||||
uip_len -= sizeof(struct uip_eth_hdr);
|
||||
|
||||
/* Only insert/update an entry if the source IP address of the
|
||||
incoming IP packet comes from a host on the local network. */
|
||||
if((IPBUF->srcipaddr[0] & uip_arp_netmask[0]) !=
|
||||
(uip_hostaddr[0] & uip_arp_netmask[0])) {
|
||||
return;
|
||||
}
|
||||
if((IPBUF->srcipaddr[1] & uip_arp_netmask[1]) !=
|
||||
(uip_hostaddr[1] & uip_arp_netmask[1])) {
|
||||
return;
|
||||
}
|
||||
uip_arp_update(IPBUF->srcipaddr, &(IPBUF->ethhdr.src));
|
||||
|
||||
return;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* ARP processing for incoming ARP packets.
|
||||
*
|
||||
* This function should be called by the device driver when an ARP
|
||||
* packet has been received. The function will act differently
|
||||
* depending on the ARP packet type: if it is a reply for a request
|
||||
* that we previously sent out, the ARP cache will be filled in with
|
||||
* the values from the ARP reply. If the incoming ARP packet is an ARP
|
||||
* request for our IP address, an ARP reply packet is created and put
|
||||
* into the uip_buf[] buffer.
|
||||
*
|
||||
* When the function returns, the value of the global variable uip_len
|
||||
* indicates whether the device driver should send out a packet or
|
||||
* not. If uip_len is zero, no packet should be sent. If uip_len is
|
||||
* non-zero, it contains the length of the outbound packet that is
|
||||
* present in the uip_buf[] buffer.
|
||||
*
|
||||
* This function expects an ARP packet with a prepended Ethernet
|
||||
* header in the uip_buf[] buffer, and the length of the packet in the
|
||||
* global variable uip_len.
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_arp_arpin(void)
|
||||
{
|
||||
|
||||
if(uip_len < sizeof(struct arp_hdr_httpd)) {
|
||||
uip_len = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
uip_len = 0;
|
||||
|
||||
switch(BUF->opcode) {
|
||||
case HTONS(ARP_REQUEST):
|
||||
/* ARP request. If it asked for our address, we send out a
|
||||
reply. */
|
||||
if(BUF->dipaddr[0] == uip_hostaddr[0] &&
|
||||
BUF->dipaddr[1] == uip_hostaddr[1]) {
|
||||
/* The reply opcode is 2. */
|
||||
BUF->opcode = HTONS(2);
|
||||
|
||||
memcpy(BUF->dhwaddr.addr, BUF->shwaddr.addr, 6);
|
||||
memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6);
|
||||
memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
|
||||
memcpy(BUF->ethhdr.dest.addr, BUF->dhwaddr.addr, 6);
|
||||
|
||||
BUF->dipaddr[0] = BUF->sipaddr[0];
|
||||
BUF->dipaddr[1] = BUF->sipaddr[1];
|
||||
BUF->sipaddr[0] = uip_hostaddr[0];
|
||||
BUF->sipaddr[1] = uip_hostaddr[1];
|
||||
|
||||
BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
|
||||
uip_len = sizeof(struct arp_hdr_httpd);
|
||||
}
|
||||
break;
|
||||
case HTONS(ARP_REPLY):
|
||||
/* ARP reply. We insert or update the ARP table if it was meant
|
||||
for us. */
|
||||
if(BUF->dipaddr[0] == uip_hostaddr[0] &&
|
||||
BUF->dipaddr[1] == uip_hostaddr[1]) {
|
||||
|
||||
uip_arp_update(BUF->sipaddr, &BUF->shwaddr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Prepend Ethernet header to an outbound IP packet and see if we need
|
||||
* to send out an ARP request.
|
||||
*
|
||||
* This function should be called before sending out an IP packet. The
|
||||
* function checks the destination IP address of the IP packet to see
|
||||
* what Ethernet MAC address that should be used as a destination MAC
|
||||
* address on the Ethernet.
|
||||
*
|
||||
* If the destination IP address is in the local network (determined
|
||||
* by logical ANDing of netmask and our IP address), the function
|
||||
* checks the ARP cache to see if an entry for the destination IP
|
||||
* address is found. If so, an Ethernet header is prepended and the
|
||||
* function returns. If no ARP cache entry is found for the
|
||||
* destination IP address, the packet in the uip_buf[] is replaced by
|
||||
* an ARP request packet for the IP address. The IP packet is dropped
|
||||
* and it is assumed that they higher level protocols (e.g., TCP)
|
||||
* eventually will retransmit the dropped packet.
|
||||
*
|
||||
* If the destination IP address is not on the local network, the IP
|
||||
* address of the default router is used instead.
|
||||
*
|
||||
* When the function returns, a packet is present in the uip_buf[]
|
||||
* buffer, and the length of the packet is in the global variable
|
||||
* uip_len.
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_arp_out(void)
|
||||
{
|
||||
struct arp_entry *tabptr = 0;
|
||||
/* Find the destination IP address in the ARP table and construct
|
||||
the Ethernet header. If the destination IP addres isn't on the
|
||||
local network, we use the default router's IP address instead.
|
||||
|
||||
If not ARP table entry is found, we overwrite the original IP
|
||||
packet with an ARP request for the IP address. */
|
||||
|
||||
/* Check if the destination address is on the local network. */
|
||||
if((IPBUF->destipaddr[0] & uip_arp_netmask[0]) !=
|
||||
(uip_hostaddr[0] & uip_arp_netmask[0]) ||
|
||||
(IPBUF->destipaddr[1] & uip_arp_netmask[1]) !=
|
||||
(uip_hostaddr[1] & uip_arp_netmask[1])) {
|
||||
/* Destination address was not on the local network, so we need to
|
||||
use the default router's IP address instead of the destination
|
||||
address when determining the MAC address. */
|
||||
ipaddr[0] = uip_arp_draddr[0];
|
||||
ipaddr[1] = uip_arp_draddr[1];
|
||||
} else {
|
||||
/* Else, we use the destination IP address. */
|
||||
ipaddr[0] = IPBUF->destipaddr[0];
|
||||
ipaddr[1] = IPBUF->destipaddr[1];
|
||||
}
|
||||
|
||||
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
|
||||
tabptr = &arp_table[i];
|
||||
if(ipaddr[0] == tabptr->ipaddr[0] &&
|
||||
ipaddr[1] == tabptr->ipaddr[1])
|
||||
break;
|
||||
}
|
||||
|
||||
if(i == UIP_ARPTAB_SIZE) {
|
||||
/* The destination address was not in our ARP table, so we
|
||||
overwrite the IP packet with an ARP request. */
|
||||
|
||||
memset(BUF->ethhdr.dest.addr, 0xff, 6);
|
||||
memset(BUF->dhwaddr.addr, 0x00, 6);
|
||||
memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
|
||||
memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6);
|
||||
|
||||
BUF->dipaddr[0] = ipaddr[0];
|
||||
BUF->dipaddr[1] = ipaddr[1];
|
||||
BUF->sipaddr[0] = uip_hostaddr[0];
|
||||
BUF->sipaddr[1] = uip_hostaddr[1];
|
||||
BUF->opcode = HTONS(ARP_REQUEST); /* ARP request. */
|
||||
BUF->hwtype = HTONS(ARP_HWTYPE_ETH);
|
||||
BUF->protocol = HTONS(UIP_ETHTYPE_IP);
|
||||
BUF->hwlen = 6;
|
||||
BUF->protolen = 4;
|
||||
BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
|
||||
|
||||
uip_appdata = &uip_buf[40 + UIP_LLH_LEN];
|
||||
|
||||
uip_len = sizeof(struct arp_hdr_httpd);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build an ethernet header. */
|
||||
memcpy(IPBUF->ethhdr.dest.addr, tabptr->ethaddr.addr, 6);
|
||||
memcpy(IPBUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
|
||||
|
||||
IPBUF->ethhdr.type = HTONS(UIP_ETHTYPE_IP);
|
||||
|
||||
uip_len += sizeof(struct uip_eth_hdr);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
/** @} */
|
||||
/** @} */
|
||||
201
common/package/boot/uboot-ipq40xx/src/httpd/uip_arp.h
Normal file
201
common/package/boot/uboot-ipq40xx/src/httpd/uip_arp.h
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
/**
|
||||
* \addtogroup uip
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \addtogroup uiparp
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Macros and definitions for the ARP module.
|
||||
* \author Adam Dunkels <adam@dunkels.com>
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2003, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 is part of the uIP TCP/IP stack.
|
||||
*
|
||||
* $Id: uip_arp.h,v 1.3.2.2 2003/10/06 15:10:22 adam Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __UIP_ARP_H__
|
||||
#define __UIP_ARP_H__
|
||||
|
||||
#include "uip.h"
|
||||
|
||||
|
||||
/**
|
||||
* Representation of a 48-bit Ethernet address.
|
||||
*/
|
||||
struct uip_eth_addr {
|
||||
u8_t addr[6];
|
||||
};
|
||||
|
||||
extern struct uip_eth_addr uip_ethaddr;
|
||||
|
||||
/**
|
||||
* The Ethernet header.
|
||||
*/
|
||||
struct uip_eth_hdr {
|
||||
struct uip_eth_addr dest;
|
||||
struct uip_eth_addr src;
|
||||
u16_t type;
|
||||
};
|
||||
|
||||
#define UIP_ETHTYPE_ARP 0x0806
|
||||
#define UIP_ETHTYPE_IP 0x0800
|
||||
#define UIP_ETHTYPE_IP6 0x86dd
|
||||
|
||||
|
||||
/* The uip_arp_init() function must be called before any of the other
|
||||
ARP functions. */
|
||||
void uip_arp_init(void);
|
||||
|
||||
/* The uip_arp_ipin() function should be called whenever an IP packet
|
||||
arrives from the Ethernet. This function refreshes the ARP table or
|
||||
inserts a new mapping if none exists. The function assumes that an
|
||||
IP packet with an Ethernet header is present in the uip_buf buffer
|
||||
and that the length of the packet is in the uip_len variable. */
|
||||
void uip_arp_ipin(void);
|
||||
|
||||
/* The uip_arp_arpin() should be called when an ARP packet is received
|
||||
by the Ethernet driver. This function also assumes that the
|
||||
Ethernet frame is present in the uip_buf buffer. When the
|
||||
uip_arp_arpin() function returns, the contents of the uip_buf
|
||||
buffer should be sent out on the Ethernet if the uip_len variable
|
||||
is > 0. */
|
||||
void uip_arp_arpin(void);
|
||||
|
||||
/* The uip_arp_out() function should be called when an IP packet
|
||||
should be sent out on the Ethernet. This function creates an
|
||||
Ethernet header before the IP header in the uip_buf buffer. The
|
||||
Ethernet header will have the correct Ethernet MAC destination
|
||||
address filled in if an ARP table entry for the destination IP
|
||||
address (or the IP address of the default router) is present. If no
|
||||
such table entry is found, the IP packet is overwritten with an ARP
|
||||
request and we rely on TCP to retransmit the packet that was
|
||||
overwritten. In any case, the uip_len variable holds the length of
|
||||
the Ethernet frame that should be transmitted. */
|
||||
void uip_arp_out(void);
|
||||
|
||||
/* The uip_arp_timer() function should be called every ten seconds. It
|
||||
is responsible for flushing old entries in the ARP table. */
|
||||
void uip_arp_timer(void);
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* \addtogroup uipconffunc
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the default router's IP address.
|
||||
*
|
||||
* \param addr A pointer to a 4-byte array containing the IP address
|
||||
* of the default router.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define uip_setdraddr(addr) do { uip_arp_draddr[0] = addr[0]; \
|
||||
uip_arp_draddr[1] = addr[1]; } while(0)
|
||||
|
||||
/**
|
||||
* Set the netmask.
|
||||
*
|
||||
* \param addr A pointer to a 4-byte array containing the IP address
|
||||
* of the netmask.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define uip_setnetmask(addr) do { uip_arp_netmask[0] = addr[0]; \
|
||||
uip_arp_netmask[1] = addr[1]; } while(0)
|
||||
|
||||
|
||||
/**
|
||||
* Get the default router's IP address.
|
||||
*
|
||||
* \param addr A pointer to a 4-byte array that will be filled in with
|
||||
* the IP address of the default router.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define uip_getdraddr(addr) do { addr[0] = uip_arp_draddr[0]; \
|
||||
addr[1] = uip_arp_draddr[1]; } while(0)
|
||||
|
||||
/**
|
||||
* Get the netmask.
|
||||
*
|
||||
* \param addr A pointer to a 4-byte array that will be filled in with
|
||||
* the value of the netmask.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define uip_getnetmask(addr) do { addr[0] = uip_arp_netmask[0]; \
|
||||
addr[1] = uip_arp_netmask[1]; } while(0)
|
||||
|
||||
|
||||
/**
|
||||
* Specifiy the Ethernet MAC address.
|
||||
*
|
||||
* The ARP code needs to know the MAC address of the Ethernet card in
|
||||
* order to be able to respond to ARP queries and to generate working
|
||||
* Ethernet headers.
|
||||
*
|
||||
* \note This macro only specifies the Ethernet MAC address to the ARP
|
||||
* code. It cannot be used to change the MAC address of the Ethernet
|
||||
* card.
|
||||
*
|
||||
* \param eaddr A pointer to a struct uip_eth_addr containing the
|
||||
* Ethernet MAC address of the Ethernet card.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define uip_setethaddr(eaddr) do {uip_ethaddr.addr[0] = eaddr.addr[0]; \
|
||||
uip_ethaddr.addr[1] = eaddr.addr[1];\
|
||||
uip_ethaddr.addr[2] = eaddr.addr[2];\
|
||||
uip_ethaddr.addr[3] = eaddr.addr[3];\
|
||||
uip_ethaddr.addr[4] = eaddr.addr[4];\
|
||||
uip_ethaddr.addr[5] = eaddr.addr[5];} while(0)
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* \internal Internal variables that are set using the macros
|
||||
* uip_setdraddr and uip_setnetmask.
|
||||
*/
|
||||
extern u16_t uip_arp_draddr[2], uip_arp_netmask[2];
|
||||
#endif /* __UIP_ARP_H__ */
|
||||
|
||||
|
||||
566
common/package/boot/uboot-ipq40xx/src/httpd/uipopt.h
Normal file
566
common/package/boot/uboot-ipq40xx/src/httpd/uipopt.h
Normal file
|
|
@ -0,0 +1,566 @@
|
|||
/**
|
||||
* \defgroup uipopt Configuration options for uIP
|
||||
* @{
|
||||
*
|
||||
* uIP is configured using the per-project configuration file
|
||||
* "uipopt.h". This file contains all compile-time options for uIP and
|
||||
* should be tweaked to match each specific project. The uIP
|
||||
* distribution contains a documented example "uipopt.h" that can be
|
||||
* copied and modified for each project.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Configuration options for uIP.
|
||||
* \author Adam Dunkels <adam@dunkels.com>
|
||||
*
|
||||
* This file is used for tweaking various configuration options for
|
||||
* uIP. You should make a copy of this file into one of your project's
|
||||
* directories instead of editing this example "uipopt.h" file that
|
||||
* comes with the uIP distribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2003, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 is part of the uIP TCP/IP stack.
|
||||
*
|
||||
* $Id: uipopt.h,v 1.16.2.5 2003/10/07 13:22:51 adam Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __UIPOPT_H__
|
||||
#define __UIPOPT_H__
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \defgroup uipopttypedef uIP type definitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* The 8-bit unsigned data type.
|
||||
*
|
||||
* This may have to be tweaked for your particular compiler. "unsigned
|
||||
* char" works for most compilers.
|
||||
*/
|
||||
typedef unsigned char u8_t;
|
||||
|
||||
/**
|
||||
* The 16-bit unsigned data type.
|
||||
*
|
||||
* This may have to be tweaked for your particular compiler. "unsigned
|
||||
* short" works for most compilers.
|
||||
*/
|
||||
typedef unsigned short u16_t;
|
||||
|
||||
/**
|
||||
* The 32-bit unsigned data type.
|
||||
*
|
||||
* This may have to be tweaked for your particular compiler. "unsigned
|
||||
* long" works for most compilers.
|
||||
*/
|
||||
typedef unsigned long u32_t;
|
||||
/**
|
||||
* The statistics data type.
|
||||
*
|
||||
* This datatype determines how high the statistics counters are able
|
||||
* to count.
|
||||
*/
|
||||
typedef unsigned short uip_stats_t;
|
||||
|
||||
/** @} */
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* \defgroup uipoptstaticconf Static configuration options
|
||||
* @{
|
||||
*
|
||||
* These configuration options can be used for setting the IP address
|
||||
* settings statically, but only if UIP_FIXEDADDR is set to 1. The
|
||||
* configuration options for a specific node includes IP address,
|
||||
* netmask and default router as well as the Ethernet address. The
|
||||
* netmask, default router and Ethernet address are appliciable only
|
||||
* if uIP should be run over Ethernet.
|
||||
*
|
||||
* All of these should be changed to suit your project.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Determines if uIP should use a fixed IP address or not.
|
||||
*
|
||||
* If uIP should use a fixed IP address, the settings are set in the
|
||||
* uipopt.h file. If not, the macros uip_sethostaddr(),
|
||||
* uip_setdraddr() and uip_setnetmask() should be used instead.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_FIXEDADDR 0
|
||||
|
||||
/**
|
||||
* Ping IP address asignment.
|
||||
*
|
||||
* uIP uses a "ping" packets for setting its own IP address if this
|
||||
* option is set. If so, uIP will start with an empty IP address and
|
||||
* the destination IP address of the first incoming "ping" (ICMP echo)
|
||||
* packet will be used for setting the hosts IP address.
|
||||
*
|
||||
* \note This works only if UIP_FIXEDADDR is 0.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_PINGADDRCONF 0
|
||||
|
||||
#define UIP_IPADDR0 192 /**< The first octet of the IP address of
|
||||
this uIP node, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_IPADDR1 168 /**< The second octet of the IP address of
|
||||
this uIP node, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_IPADDR2 0 /**< The third octet of the IP address of
|
||||
this uIP node, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_IPADDR3 250 /**< The fourth octet of the IP address of
|
||||
this uIP node, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
|
||||
#define UIP_NETMASK0 255 /**< The first octet of the netmask of
|
||||
this uIP node, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_NETMASK1 255 /**< The second octet of the netmask of
|
||||
this uIP node, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_NETMASK2 255 /**< The third octet of the netmask of
|
||||
this uIP node, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_NETMASK3 0 /**< The fourth octet of the netmask of
|
||||
this uIP node, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
|
||||
#define UIP_DRIPADDR0 192 /**< The first octet of the IP address of
|
||||
the default router, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_DRIPADDR1 168 /**< The second octet of the IP address of
|
||||
the default router, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_DRIPADDR2 0 /**< The third octet of the IP address of
|
||||
the default router, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_DRIPADDR3 1 /**< The fourth octet of the IP address of
|
||||
the default router, if UIP_FIXEDADDR is
|
||||
1. \hideinitializer */
|
||||
|
||||
/**
|
||||
* Specifies if the uIP ARP module should be compiled with a fixed
|
||||
* Ethernet MAC address or not.
|
||||
*
|
||||
* If this configuration option is 0, the macro uip_setethaddr() can
|
||||
* be used to specify the Ethernet address at run-time.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_FIXEDETHADDR 0
|
||||
|
||||
#define UIP_ETHADDR0 0x00 /**< The first octet of the Ethernet
|
||||
address if UIP_FIXEDETHADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_ETHADDR1 0xbd /**< The second octet of the Ethernet
|
||||
address if UIP_FIXEDETHADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_ETHADDR2 0x3b /**< The third octet of the Ethernet
|
||||
address if UIP_FIXEDETHADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_ETHADDR3 0x33 /**< The fourth octet of the Ethernet
|
||||
address if UIP_FIXEDETHADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_ETHADDR4 0x05 /**< The fifth octet of the Ethernet
|
||||
address if UIP_FIXEDETHADDR is
|
||||
1. \hideinitializer */
|
||||
#define UIP_ETHADDR5 0x71 /**< The sixth octet of the Ethernet
|
||||
address if UIP_FIXEDETHADDR is
|
||||
1. \hideinitializer */
|
||||
|
||||
/** @} */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \defgroup uipoptip IP configuration options
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* The IP TTL (time to live) of IP packets sent by uIP.
|
||||
*
|
||||
* This should normally not be changed.
|
||||
*/
|
||||
#define UIP_TTL 255
|
||||
|
||||
/**
|
||||
* Turn on support for IP packet reassembly.
|
||||
*
|
||||
* uIP supports reassembly of fragmented IP packets. This features
|
||||
* requires an additonal amount of RAM to hold the reassembly buffer
|
||||
* and the reassembly code size is approximately 700 bytes. The
|
||||
* reassembly buffer is of the same size as the uip_buf buffer
|
||||
* (configured by UIP_BUFSIZE).
|
||||
*
|
||||
* \note IP packet reassembly is not heavily tested.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_REASSEMBLY 0
|
||||
|
||||
/**
|
||||
* The maximum time an IP fragment should wait in the reassembly
|
||||
* buffer before it is dropped.
|
||||
*
|
||||
*/
|
||||
#define UIP_REASS_MAXAGE 40
|
||||
|
||||
/** @} */
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \defgroup uipoptudp UDP configuration options
|
||||
* @{
|
||||
*
|
||||
* \note The UDP support in uIP is still not entirely complete; there
|
||||
* is no support for sending or receiving broadcast or multicast
|
||||
* packets, but it works well enough to support a number of vital
|
||||
* applications such as DNS queries, though
|
||||
*/
|
||||
|
||||
/**
|
||||
* Toggles wether UDP support should be compiled in or not.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_UDP 0
|
||||
|
||||
/**
|
||||
* Toggles if UDP checksums should be used or not.
|
||||
*
|
||||
* \note Support for UDP checksums is currently not included in uIP,
|
||||
* so this option has no function.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_UDP_CHECKSUMS 0
|
||||
|
||||
/**
|
||||
* The maximum amount of concurrent UDP connections.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_UDP_CONNS 10
|
||||
|
||||
/**
|
||||
* The name of the function that should be called when UDP datagrams arrive.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_UDP_APPCALL udp_appcall
|
||||
|
||||
/** @} */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \defgroup uipopttcp TCP configuration options
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Determines if support for opening connections from uIP should be
|
||||
* compiled in.
|
||||
*
|
||||
* If the applications that are running on top of uIP for this project
|
||||
* do not need to open outgoing TCP connections, this configration
|
||||
* option can be turned off to reduce the code size of uIP.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_ACTIVE_OPEN 0
|
||||
|
||||
/**
|
||||
* The maximum number of simultaneously open TCP connections.
|
||||
*
|
||||
* Since the TCP connections are statically allocated, turning this
|
||||
* configuration knob down results in less RAM used. Each TCP
|
||||
* connection requires approximatly 30 bytes of memory.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_CONNS 2
|
||||
|
||||
/**
|
||||
* The maximum number of simultaneously listening TCP ports.
|
||||
*
|
||||
* Each listening TCP port requires 2 bytes of memory.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_LISTENPORTS 1
|
||||
|
||||
/**
|
||||
* The size of the advertised receiver's window.
|
||||
*
|
||||
* Should be set low (i.e., to the size of the uip_buf buffer) is the
|
||||
* application is slow to process incoming data, or high (32768 bytes)
|
||||
* if the application processes data quickly.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
//#define UIP_RECEIVE_WINDOW 32768
|
||||
#define UIP_RECEIVE_WINDOW 3000
|
||||
|
||||
/**
|
||||
* Determines if support for TCP urgent data notification should be
|
||||
* compiled in.
|
||||
*
|
||||
* Urgent data (out-of-band data) is a rarely used TCP feature that
|
||||
* very seldom would be required.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
//#define UIP_URGDATA 0
|
||||
#define UIP_URGDATA 1
|
||||
|
||||
/**
|
||||
* The initial retransmission timeout counted in timer pulses.
|
||||
*
|
||||
* This should not be changed.
|
||||
*/
|
||||
#define UIP_RTO 3
|
||||
|
||||
/**
|
||||
* The maximum number of times a segment should be retransmitted
|
||||
* before the connection should be aborted.
|
||||
*
|
||||
* This should not be changed.
|
||||
*/
|
||||
#define UIP_MAXRTX 8
|
||||
|
||||
/**
|
||||
* The maximum number of times a SYN segment should be retransmitted
|
||||
* before a connection request should be deemed to have been
|
||||
* unsuccessful.
|
||||
*
|
||||
* This should not need to be changed.
|
||||
*/
|
||||
#define UIP_MAXSYNRTX 3
|
||||
|
||||
/**
|
||||
* The TCP maximum segment size.
|
||||
*
|
||||
* This is should not be to set to more than UIP_BUFSIZE - UIP_LLH_LEN - 40.
|
||||
*/
|
||||
#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - 40)
|
||||
|
||||
/**
|
||||
* How long a connection should stay in the TIME_WAIT state.
|
||||
*
|
||||
* This configiration option has no real implication, and it should be
|
||||
* left untouched.
|
||||
*/
|
||||
#define UIP_TIME_WAIT_TIMEOUT 120
|
||||
|
||||
|
||||
/** @} */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \defgroup uipoptarp ARP configuration options
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* The size of the ARP table.
|
||||
*
|
||||
* This option should be set to a larger value if this uIP node will
|
||||
* have many connections from the local network.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_ARPTAB_SIZE 2
|
||||
|
||||
/**
|
||||
* The maxium age of ARP table entries measured in 10ths of seconds.
|
||||
*
|
||||
* An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD
|
||||
* default).
|
||||
*/
|
||||
#define UIP_ARP_MAXAGE 120
|
||||
|
||||
/** @} */
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* \defgroup uipoptgeneral General configuration options
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* The size of the uIP packet buffer.
|
||||
*
|
||||
* The uIP packet buffer should not be smaller than 60 bytes, and does
|
||||
* not need to be larger than 1500 bytes. Lower size results in lower
|
||||
* TCP throughput, larger size results in higher TCP throughput.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_BUFSIZE 1500
|
||||
|
||||
|
||||
/**
|
||||
* Determines if statistics support should be compiled in.
|
||||
*
|
||||
* The statistics is useful for debugging and to show the user.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_STATISTICS 0
|
||||
|
||||
/**
|
||||
* Determines if logging of certain events should be compiled in.
|
||||
*
|
||||
* This is useful mostly for debugging. The function uip_log()
|
||||
* must be implemented to suit the architecture of the project, if
|
||||
* logging is turned on.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_LOGGING 0
|
||||
|
||||
/**
|
||||
* Print out a uIP log message.
|
||||
*
|
||||
* This function must be implemented by the module that uses uIP, and
|
||||
* is called by uIP whenever a log message is generated.
|
||||
*/
|
||||
void uip_log(char *msg);
|
||||
|
||||
/**
|
||||
* The link level header length.
|
||||
*
|
||||
* This is the offset into the uip_buf where the IP header can be
|
||||
* found. For Ethernet, this should be set to 14. For SLIP, this
|
||||
* should be set to 0.
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define UIP_LLH_LEN 14
|
||||
|
||||
|
||||
/** @} */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \defgroup uipoptcpu CPU architecture configuration
|
||||
* @{
|
||||
*
|
||||
* The CPU architecture configuration is where the endianess of the
|
||||
* CPU on which uIP is to be run is specified. Most CPUs today are
|
||||
* little endian, and the most notable exception are the Motorolas
|
||||
* which are big endian. The BYTE_ORDER macro should be changed to
|
||||
* reflect the CPU architecture on which uIP is to be run.
|
||||
*/
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 3412
|
||||
#endif /* LITTLE_ENDIAN */
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN 1234
|
||||
#endif /* BIGE_ENDIAN */
|
||||
|
||||
/**
|
||||
* The byte order of the CPU architecture on which uIP is to be run.
|
||||
*
|
||||
* This option can be either BIG_ENDIAN (Motorola byte order) or
|
||||
* LITTLE_ENDIAN (Intel byte order).
|
||||
*
|
||||
* \hideinitializer
|
||||
*/
|
||||
/*#ifndef BYTE_ORDER*/
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
/*#endif*/ /* BYTE_ORDER */
|
||||
|
||||
/** @} */
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* \defgroup uipoptapp Appication specific configurations
|
||||
* @{
|
||||
*
|
||||
* An uIP application is implemented using a single application
|
||||
* function that is called by uIP whenever a TCP/IP event occurs. The
|
||||
* name of this function must be registered with uIP at compile time
|
||||
* using the UIP_APPCALL definition.
|
||||
*
|
||||
* uIP applications can store the application state within the
|
||||
* uip_conn structure by specifying the size of the application
|
||||
* structure with the UIP_APPSTATE_SIZE macro.
|
||||
*
|
||||
* The file containing the definitions must be included in the
|
||||
* uipopt.h file.
|
||||
*
|
||||
* The following example illustrates how this can look.
|
||||
\code
|
||||
|
||||
void httpd_appcall(void);
|
||||
#define UIP_APPCALL httpd_appcall
|
||||
|
||||
struct httpd_state {
|
||||
u8_t state;
|
||||
u16_t count;
|
||||
char *dataptr;
|
||||
char *script;
|
||||
};
|
||||
#define UIP_APPSTATE_SIZE (sizeof(struct httpd_state))
|
||||
\endcode
|
||||
*/
|
||||
|
||||
/**
|
||||
* \var #define UIP_APPCALL
|
||||
*
|
||||
* The name of the application function that uIP should call in
|
||||
* response to TCP/IP events.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \var #define UIP_APPSTATE_SIZE
|
||||
*
|
||||
* The size of the application state that is to be stored in the
|
||||
* uip_conn structure.
|
||||
*/
|
||||
/** @} */
|
||||
|
||||
/* Include the header file for the application program that should be
|
||||
used. If you don't use the example web server, you should change
|
||||
this. */
|
||||
#include "httpd.h"
|
||||
|
||||
|
||||
#endif /* __UIPOPT_H__ */
|
||||
15
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/404.html
vendored
Normal file
15
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/404.html
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Page not found</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1 class="red">PAGE NOT FOUND</h1>
|
||||
<div class="i e">The page you were looking for doesn't exist!</div>
|
||||
</div>
|
||||
<div id="f">You can find more information about this project on <a href="https://github.com/pepe2k/u-boot_mod" target="_blank">GitHub</a></div>
|
||||
</body>
|
||||
</html>
|
||||
24
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/art.html
vendored
Normal file
24
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/art.html
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ART update</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1>ART UPDATE</h1>
|
||||
<p>You are going to update <strong>ART (Atheros Radio Test)</strong> on the device.<br>Please, choose file from your local hard drive and click <strong>Update ART</strong> button.</p>
|
||||
<form method="post" enctype="multipart/form-data"><input type="file" name="art"><input type="submit" value="Update ART"></form>
|
||||
<div class="i w">
|
||||
<strong>WARNINGS</strong>
|
||||
<ul>
|
||||
<li>do not power off the device during update</li>
|
||||
<li>if everything goes well, the device will restart</li>
|
||||
<li>you can upload whatever you want, so be sure that you choose proper ART image for your device</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="f">You can find more information about this project on <a href="https://github.com/pepe2k/u-boot_mod" target="_blank">GitHub</a></div>
|
||||
</body>
|
||||
</html>
|
||||
15
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/fail.html
vendored
Normal file
15
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/fail.html
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Update failed</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1 class="red">UPDATE FAILED</h1>
|
||||
<div class="i e"><strong>Something went wrong during update</strong>Probably you have chosen wrong file (too big or too small) or you were trying to update ART on device with unknown FLASH type (and size) which is not allowed. Please, try again or contact with the author of this modification. You can also get more information during update in U-Boot console.</div>
|
||||
</div>
|
||||
<div id="f">You can find more information about this project on <a href="https://github.com/pepe2k/u-boot_mod" target="_blank">GitHub</a></div>
|
||||
</body>
|
||||
</html>
|
||||
17
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/flashing.html
vendored
Normal file
17
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/flashing.html
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Update in progress</title>
|
||||
<style>h1,p,ul{margin:0;padding:0}html,body{font:13px/20px Arial,sans-serif;background:#EDEDED}#m{max-width:750px;margin:30px auto 10px;border:solid 1px #BABABA;background:#FFF;border-radius:7px;box-shadow:0 0 10px #D2D1D1}#m > *{padding:20px}h1{font:bold 50px/50px Tahoma;border-bottom:solid 1px #E8E8E8}a,h1{color:#2450AD;text-decoration:none}.i{margin:20px;border-radius:7px;text-align:justify}.w{background:#FEFDCE;border:solid 1px #FFC643}#f{text-align:center;color:#969393}form,p,h1{text-align:center}ul{list-style:square;margin:0 0 0 20px}.i strong{margin:0 0 5px;display:block}#l{height:30px;width:30px;margin:0 auto 20px;-webkit-animation:r 1s infinite linear;-moz-animation:r 1s infinite linear;-o-animation:r 1s infinite linear;animation:r 1s infinite linear;border-left:7px solid #EAF1FF;border-right:7px solid #EAF1FF;border-bottom:7px solid #EAF1FF;border-top:7px solid #2450AD;border-radius:100%}@-webkit-keyframes r{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-moz-keyframes r{from{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-o-keyframes r{from{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@keyframes r{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1>UPDATE IN PROGRESS</h1>
|
||||
<p>Your file was successfully uploaded! Update is in progress and you should wait for automatic reset of the device.<br>Update time depends on image size and may take up to a few minutes. You can close this page.</p>
|
||||
<div id="l"></div>
|
||||
</div>
|
||||
<div id="f">You can find more information about this project on <a href="https://github.com/pepe2k/u-boot_mod" target="_blank">GitHub</a></div>
|
||||
</body>
|
||||
</html>
|
||||
24
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/index.html
vendored
Normal file
24
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/index.html
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Firmware update</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1>FIRMWARE UPDATE</h1>
|
||||
<p>You are going to update <strong>firmware</strong> on the device.<br>Please, choose file from your local hard drive and click <strong>Update firmware</strong> button.</p>
|
||||
<form method="post" enctype="multipart/form-data"><input type="file" name="firmware"><input type="submit" value="Update firmware"></form>
|
||||
<div class="i w">
|
||||
<strong>WARNINGS</strong>
|
||||
<ul>
|
||||
<li>do not power off the device during update</li>
|
||||
<li>if everything goes well, the device will restart</li>
|
||||
<li>you can upload whatever you want, so be sure that you choose proper firmware image for your device</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="f">You can find more information about this project on <a href="https://github.com/pepe2k/u-boot_mod" target="_blank">GitHub</a></div>
|
||||
</body>
|
||||
</html>
|
||||
78
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/style.css
vendored
Normal file
78
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/style.css
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
h1,
|
||||
p,
|
||||
form,
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
font: 13px/20px Arial, sans-serif;
|
||||
background: #EDEDED;
|
||||
}
|
||||
|
||||
#m {
|
||||
max-width: 750px;
|
||||
margin: 30px auto 10px;
|
||||
border: solid 1px #BABABA;
|
||||
background: #FFF;
|
||||
border-radius: 7px;
|
||||
box-shadow: 0 0 10px #D2D1D1;
|
||||
}
|
||||
|
||||
#m > * {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font: bold 50px/50px Tahoma;
|
||||
border-bottom: solid 1px #E8E8E8;
|
||||
}
|
||||
|
||||
a,
|
||||
h1 {
|
||||
color: #2450AD;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.i {
|
||||
margin: 20px;
|
||||
border-radius: 7px;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.w {
|
||||
background: #FEFDCE;
|
||||
border: solid 1px #FFC643;
|
||||
}
|
||||
|
||||
.e {
|
||||
background: #FFE7E7;
|
||||
border:solid 1px #FE7171;
|
||||
}
|
||||
|
||||
#f {
|
||||
text-align: center;
|
||||
color: #969393;
|
||||
}
|
||||
|
||||
form,
|
||||
p,
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: square;
|
||||
margin: 0 0 0 20px;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #E41616;
|
||||
}
|
||||
|
||||
.i strong {
|
||||
margin: 0 0 5px;
|
||||
display: block;
|
||||
}
|
||||
25
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/uboot.html
vendored
Normal file
25
common/package/boot/uboot-ipq40xx/src/httpd/vendors/general/uboot.html
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>U-Boot update</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1>U-BOOT UPDATE</h1>
|
||||
<p>You are going to update <strong>U-Boot bootloader</strong> on the device.<br>Please, choose file from your local hard drive and click <strong>Update U-Boot</strong> button.</p>
|
||||
<form method="post" enctype="multipart/form-data"><input type="file" name="uboot"><input type="submit" value="Update U-Boot"></form>
|
||||
<div class="i w">
|
||||
<strong>WARNINGS</strong>
|
||||
<ul>
|
||||
<li>do not power off the device during update</li>
|
||||
<li>if everything goes well, the device will restart</li>
|
||||
<li>you can upload whatever you want, so be sure that you choose proper U-Boot image for your device</li>
|
||||
<li>updating U-Boot is a very dangerous operation and may damage your device!</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="f">You can find more information about this project on <a href="https://github.com/pepe2k/u-boot_mod" target="_blank">GitHub</a></div>
|
||||
</body>
|
||||
</html>
|
||||
199
common/package/boot/uboot-ipq40xx/src/httpd/vendors/makefsdatac
vendored
Executable file
199
common/package/boot/uboot-ipq40xx/src/httpd/vendors/makefsdatac
vendored
Executable file
|
|
@ -0,0 +1,199 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2016 Piotr Dymacz <piotr@dymacz.pl>
|
||||
|
||||
# This script generates "fsdata.c" file for uIP 0.9 stack.
|
||||
# It takes one argument - name of vendor directory,
|
||||
# which should contains all www files, at least:
|
||||
# - index.html (with: <input type="file" name="firmware">)
|
||||
# - 404.html
|
||||
# - flashing.hmtl
|
||||
# - fail.html
|
||||
#
|
||||
# All other files are optional. If you want to allow also
|
||||
# ART and/or U-Boot image update, add the following files,
|
||||
# with appropriate inputs in form:
|
||||
# - art.html (<input type="file" name="art">)
|
||||
# - uboot.html (<input type="file" name="uboot">)
|
||||
#
|
||||
# HTML and CSS files are compressed before placing them
|
||||
# inside "fsdata.c" if JAVA is installed.
|
||||
#
|
||||
# You SHOULDN'T embed addresses of any external
|
||||
# files in "flashing.html" file, because web server,
|
||||
# after receive POST data, returns this page and stops.
|
||||
|
||||
# ================
|
||||
# Global variables
|
||||
# ================
|
||||
|
||||
# Vendor specific directory
|
||||
# (default: "general")
|
||||
VENDOR_DIR=${1:-general}
|
||||
|
||||
# Temporary files
|
||||
FILES_CONTENT_TMP="vendors/.files_content"
|
||||
FILES_LIST_TMP="vendors/.files_list"
|
||||
|
||||
# YUI Compressor path
|
||||
# (should be in the same dir)
|
||||
YUI_PATH=$(ls -t vendors/*.jar 2> /dev/null | tail --lines=1)
|
||||
HAVE_JAVA=0
|
||||
|
||||
# Previous fsdata_file var name
|
||||
PREV_FSDATA_STRUCT="NULL"
|
||||
|
||||
# Files counter
|
||||
FS_CNT=0
|
||||
|
||||
# Change ASCII to bytes, comma separated
|
||||
# (e.g. "0x01, 0x02, 0x03...")
|
||||
function ascii_to_bytes() {
|
||||
echo -ne "$1" |\
|
||||
od -A n -t x1 |\
|
||||
tr -d '\r\n' |\
|
||||
sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g' >> "$FILES_CONTENT_TMP"
|
||||
}
|
||||
|
||||
# $1 -> file path
|
||||
function print_data_array() {
|
||||
local f_ext="${1##*.}"
|
||||
local f_name="${1##*/}"
|
||||
local f_name_no_ext="${f_name%\.*}"
|
||||
local f_content=""
|
||||
|
||||
# Open variable declaration
|
||||
echo -ne "static const char data_${f_name_no_ext}_${f_ext}[] = {\n" \
|
||||
>> "$FILES_CONTENT_TMP"
|
||||
echo -ne "/* HTTP Header */\n" >> "$FILES_CONTENT_TMP"
|
||||
|
||||
# HTTP header (200 OK or 404 Not Found)
|
||||
if [ "$f_name_no_ext" = "404" ]; then
|
||||
ascii_to_bytes "HTTP/1.0 404 File not found\r\n"
|
||||
else
|
||||
ascii_to_bytes "HTTP/1.0 200 OK\r\n"
|
||||
fi
|
||||
|
||||
# Server type
|
||||
echo "," >> "$FILES_CONTENT_TMP"
|
||||
ascii_to_bytes "Server: uIP/0.9\r\n"
|
||||
echo "," >> "$FILES_CONTENT_TMP"
|
||||
|
||||
# Content
|
||||
case $f_ext in
|
||||
css)
|
||||
if [ $HAVE_JAVA -eq 1 ] &&\
|
||||
[ -e $YUI_PATH ]; then
|
||||
f_content=$(java -jar "$YUI_PATH" --charset utf-8 "$1" |\
|
||||
od -A n -t x1 | tr -d '\r\n' |\
|
||||
sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g')
|
||||
else
|
||||
f_content=$(cat "$1" | tr -d '\r\n\t' |\
|
||||
od -A n -t x1 | tr -d '\r\n' |\
|
||||
sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g')
|
||||
fi
|
||||
|
||||
ascii_to_bytes "Content-type: text/css; charset=UTF-8\r\n\r\n"
|
||||
;;
|
||||
png)
|
||||
f_content=$(od -A n -t x1 < "$1" | tr -d '\r\n' |\
|
||||
sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g')
|
||||
ascii_to_bytes "Content-Type: image/png\r\n\r\n"
|
||||
;;
|
||||
jpg|jpeg)
|
||||
f_content=$(od -A n -t x1 < "$1" | tr -d '\r\n' |\
|
||||
sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g')
|
||||
ascii_to_bytes "Content-Type: image/jpeg\r\n\r\n"
|
||||
;;
|
||||
gif)
|
||||
f_content=$(od -A n -t x1 < "$1" | tr -d '\r\n' |\
|
||||
sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g')
|
||||
ascii_to_bytes "Content-Type: image/gif\r\n\r\n"
|
||||
;;
|
||||
htm|html)
|
||||
f_content=$(cat "$1" | tr -d '\t\r\n' |\
|
||||
od -A n -t x1 | tr -d '\r\n' |\
|
||||
sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g')
|
||||
ascii_to_bytes "Content-type: text/html; charset=UTF-8\r\n\r\n"
|
||||
;;
|
||||
svg)
|
||||
f_content=$(cat "$1" | tr -d '\t\r\n' |\
|
||||
od -A n -t x1 | tr -d '\r\n' |\
|
||||
sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g')
|
||||
ascii_to_bytes "Content-type: image/svg+xml; charset=UTF-8\r\n\r\n"
|
||||
;;
|
||||
*)
|
||||
echo "ERROR! Unsupported file type: '${f_name}'!"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
echo "," >> "$FILES_CONTENT_TMP"
|
||||
|
||||
# File content
|
||||
echo -ne "/* Page/File content */\n" >> "$FILES_CONTENT_TMP"
|
||||
echo -ne "${f_content}" >> "$FILES_CONTENT_TMP"
|
||||
|
||||
# And close declaration
|
||||
echo -ne ", 0 };\n\n" >> "$FILES_CONTENT_TMP"
|
||||
}
|
||||
|
||||
# $1 -> file path
|
||||
function print_data_struct() {
|
||||
local f_ext="${1##*.}"
|
||||
local f_name="${1##*/}"
|
||||
local f_name_no_ext="${f_name%\.*}"
|
||||
|
||||
echo -ne "const struct fsdata_file file_${f_name_no_ext}_${f_ext}[] = {{\n" >> "$FILES_LIST_TMP"
|
||||
echo -ne "\t${PREV_FSDATA_STRUCT},\n" >> "$FILES_LIST_TMP"
|
||||
echo -ne "\t\"/${f_name_no_ext}.${f_ext}\",\n" >> "$FILES_LIST_TMP"
|
||||
echo -ne "\tdata_${f_name_no_ext}_${f_ext},\n" >> "$FILES_LIST_TMP"
|
||||
echo -ne "\t(int)sizeof(data_"$f_name_no_ext"_"$f_ext") - 1\n" >> "$FILES_LIST_TMP"
|
||||
echo -ne "}};\n\n" >> "$FILES_LIST_TMP"
|
||||
|
||||
PREV_FSDATA_STRUCT="file_${f_name_no_ext}_${f_ext}"
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ -d vendors/$VENDOR_DIR ]; then
|
||||
# Do we hava java?
|
||||
which java > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
HAVE_JAVA=1
|
||||
fi
|
||||
|
||||
# Remove old fsdata.c
|
||||
if [ -e fsdata.c ]; then
|
||||
rm -f fsdata.c 2> /dev/null
|
||||
fi
|
||||
|
||||
# Temporary files
|
||||
touch "$FILES_CONTENT_TMP" \
|
||||
"$FILES_LIST_TMP"
|
||||
|
||||
# Loop through all files in vendor dir
|
||||
for file in vendors/${VENDOR_DIR}/*; do
|
||||
print_data_array "$file"
|
||||
print_data_struct "$file"
|
||||
FS_CNT=$((FS_CNT + 1))
|
||||
done
|
||||
|
||||
# Add required defines
|
||||
echo -e "#define FS_ROOT\t\t${PREV_FSDATA_STRUCT}" >> "$FILES_LIST_TMP"
|
||||
echo -e "#define FS_NUMFILES\t${FS_CNT}" >> "$FILES_LIST_TMP"
|
||||
|
||||
# Generate new fsdata.c
|
||||
cat "$FILES_CONTENT_TMP" > fsdata.c
|
||||
cat "$FILES_LIST_TMP" >> fsdata.c
|
||||
|
||||
rm -f "$FILES_CONTENT_TMP" \
|
||||
"$FILES_LIST_TMP" 2> /dev/null
|
||||
else
|
||||
echo "ERROR! Vendor specific directory (u-boot/httpd/vendors/${VENDOR_DIR}) doesn't exist!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# =====================
|
||||
# Execution begins here
|
||||
# =====================
|
||||
main
|
||||
14
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/404.html
vendored
Normal file
14
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/404.html
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Page not found</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1 class="red">Page not found</h1>
|
||||
<p>The page you were looking for doesn't exist!<br>Go back to <a href="index.html">firmware update</a> page.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
14
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/fail.html
vendored
Normal file
14
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/fail.html
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Update failed</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1 class="red">Update failed</h1>
|
||||
<p>Please, try again or contact with the support.<br>You can also get more information during update in U-Boot console.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
17
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/flashing.html
vendored
Normal file
17
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/flashing.html
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Update in progress</title>
|
||||
<style>
|
||||
h1,p,body{margin:0;padding:0}html,body{font:13px/20px Tahoma,sans-serif;background:#FFF;color:#000;text-align:center;height:100%}#m{padding:30px 0}#m>*{padding:20px}h1{font:bold 40px/40px Arial}#l{height:30px;width:30px;margin:30px auto;-webkit-animation:r 1s infinite linear;-moz-animation:r 1s infinite linear;-o-animation:r 1s infinite linear;animation:r 1s infinite linear;border-left:5px solid #FFF;border-right:5px solid #FFF;border-bottom:5px solid #000;border-top:5px solid #000;border-radius:100%}@-webkit-keyframes r{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-moz-keyframes r{from{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-o-keyframes r{from{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@keyframes r{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1>Update in progress</h1>
|
||||
<p>Your file was successfully uploaded! Update is in progress and you should wait for automatic reset of the device.<br>Update time depends on image size and may take up to a few minutes. You can close this page.</p>
|
||||
<div id="l"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
15
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/index.html
vendored
Normal file
15
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/index.html
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Firmware update</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="m">
|
||||
<h1>Firmware update</h1>
|
||||
<p>You are going to upload new firmware to the device.<br>Choose a proper file from your local hard drive and click <strong>"Update firmware"</strong> button.<br>Please, do not power off the device during update, if everything goes well, the device will restart.</p>
|
||||
<form method="post" enctype="multipart/form-data"><input type="file" name="firmware"><input type="submit" value="Update firmware"></form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
37
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/style.css
vendored
Normal file
37
common/package/boot/uboot-ipq40xx/src/httpd/vendors/oem/style.css
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
h1,
|
||||
p,
|
||||
form,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
font: 13px/20px Tahoma, sans-serif;
|
||||
background: #FFF;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#m {
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
#m > * {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0069FB;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font: bold 40px/40px Arial;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #ED0000;
|
||||
}
|
||||
29
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/404.html
vendored
Normal file
29
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/404.html
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Page not found</title>
|
||||
<style>html,body{margin:0;padding:0}h1,h2,p,a,img,strong,li,ol,ul,form,label,button,tr,th,td{margin:0;padding:0;border:0;font-weight:400;font-style:normal;font-size:100%;line-height:1;font-family:inherit}body{background-color:#fff;margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:18px;color:#404040}#m{max-width:750px;margin:30px auto 10px;border:solid 1px #BABABA;background:#FFF;border-radius:7px;box-shadow:0 0 10px #D2D1D1}#m>*{padding:20px}h1{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:30px;font-weight:700;margin-bottom:20px;color:#444;text-decoration:none;border-bottom:1px solid #AFAFAF}a{color:#404040;text-decoration:none}.i{margin:20px;border-radius:7px;text-align:justify}.w{background:#FEFDCE;border:solid 1px #FFC643}.e{background:#FFE7E7;border:solid 1px #FE7171}#f{text-align:center;color:#969393}form,p,h1{text-align:center}form{margin-bottom:20px}ul{list-style:square;margin:0 0 0 20px}.i strong{margin:0 0 5px;display:block}header{margin-bottom:60px}header a{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);font-size:15px;font-weight:700}header h3 a,header .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;color:#fff;font-size:20px;font-weight:200;line-height:1}header p{margin:0;line-height:40px}header .fill{border-bottom:1px solid #E4E4E4;padding:20px 0;max-width:940px;margin:0 auto}div.container img.logo{margin-top:6px}.container{width:100%;max-width:940px;margin-left:auto;margin-right:auto;zoom:1}.alert-message{position:relative;background:#FFF;border:1px solid #E4E4E4;border-radius:7px;padding:20px 38px;margin-bottom:18px}.alert-message.error{border-color:#DD4B39;color:#DD4B39}.alert-message.warning{border-color:#DD4B39;color:#DD4B39}#l{height:80px;width:80px;margin:0 auto 20px;-webkit-animation:r 1s infinite linear;-moz-animation:r 1s infinite linear;-o-animation:r 1s infinite linear;animation:r 1s infinite linear;border-left:7px solid #EAF1FF;border-right:7px solid #EAF1FF;border-bottom:7px solid #EAF1FF;border-top:7px solid #2450AD;border-radius:100%}@-webkit-keyframes r{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-moz-keyframes r{from{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-o-keyframes r{from{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@keyframes r{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}p{margin-bottom:20px}.footer{border-top:1px solid #DDD;padding:10.8px 12px;font-size:12px;color:#818198}.footer a{color:#818198;float:right}.heading{text-align:left}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<object class="logo" data="tlt_networks_logo.svg" type="image/svg+xml"></object>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div id="maincontent" class="container">
|
||||
<h1 class="heading">PAGE NOT FOUND</h1>
|
||||
<div class="alert-message warning error">The page you were looking for doesn't exist!</div>
|
||||
<div class="footer">
|
||||
Teltonika solutions<a href="https://teltonika-networks.com/">www.teltonika-networks.com</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
33
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/fail.html
vendored
Normal file
33
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/fail.html
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Update failed</title>
|
||||
<style>html,body{margin:0;padding:0}h1,h2,p,a,img,strong,li,ol,ul,form,label,button,tr,th,td{margin:0;padding:0;border:0;font-weight:400;font-style:normal;font-size:100%;line-height:1;font-family:inherit}body{background-color:#fff;margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:18px;color:#404040}#m{max-width:750px;margin:30px auto 10px;border:solid 1px #BABABA;background:#FFF;border-radius:7px;box-shadow:0 0 10px #D2D1D1}#m>*{padding:20px}h1{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:30px;font-weight:700;margin-bottom:20px;color:#444;text-decoration:none;border-bottom:1px solid #AFAFAF}a{color:#404040;text-decoration:none}.i{margin:20px;border-radius:7px;text-align:justify}.w{background:#FEFDCE;border:solid 1px #FFC643}.e{background:#FFE7E7;border:solid 1px #FE7171}#f{text-align:center;color:#969393}form,p,h1{text-align:center}form{margin-bottom:20px}ul{list-style:square;margin:0 0 0 20px}.i strong{margin:0 0 5px;display:block}header{margin-bottom:60px}header a{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);font-size:15px;font-weight:700}header h3 a,header .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;color:#fff;font-size:20px;font-weight:200;line-height:1}header p{margin:0;line-height:40px}header .fill{border-bottom:1px solid #E4E4E4;padding:20px 0;max-width:940px;margin:0 auto}div.container img.logo{margin-top:6px}.container{width:100%;max-width:940px;margin-left:auto;margin-right:auto;zoom:1}.alert-message{position:relative;background:#FFF;border:1px solid #E4E4E4;border-radius:7px;padding:20px 38px;margin-bottom:18px}.alert-message.error{border-color:#DD4B39;color:#DD4B39}.alert-message.warning{border-color:#DD4B39;color:#DD4B39}#l{height:80px;width:80px;margin:0 auto 20px;-webkit-animation:r 1s infinite linear;-moz-animation:r 1s infinite linear;-o-animation:r 1s infinite linear;animation:r 1s infinite linear;border-left:7px solid #EAF1FF;border-right:7px solid #EAF1FF;border-bottom:7px solid #EAF1FF;border-top:7px solid #2450AD;border-radius:100%}@-webkit-keyframes r{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-moz-keyframes r{from{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-o-keyframes r{from{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@keyframes r{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}p{margin-bottom:20px}.footer{border-top:1px solid #DDD;padding:10.8px 12px;font-size:12px;color:#818198}.footer a{color:#818198;float:right}.heading{text-align:left}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<object class="logo" data="tlt_networks_logo.svg" type="image/svg+xml"></object>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div id="maincontent" class="container">
|
||||
<h1 class="heading">UPDATE FAILED</h1>
|
||||
<div class="alert-message warning error">
|
||||
<strong>Something went wrong during update.</strong> Probably you have chosen wrong file (too big or too
|
||||
small) or you were trying to update ART on device with unknown FLASH type (and size) which is not allowed.
|
||||
Please, try again or contact with the author of this modification. You can also get more information during
|
||||
update in U-Boot console.
|
||||
</div>
|
||||
<div class="footer">
|
||||
Teltonika solutions<a href="https://teltonika-networks.com/">www.teltonika-networks.com</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
29
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/flashing.html
vendored
Normal file
29
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/flashing.html
vendored
Normal file
File diff suppressed because one or more lines are too long
39
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/index.html
vendored
Normal file
39
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/index.html
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Firmware update</title>
|
||||
<style>html,body{margin:0;padding:0}h1,h2,p,a,img,strong,li,ol,ul,form,label,button,tr,th,td{margin:0;padding:0;border:0;font-weight:400;font-style:normal;font-size:100%;line-height:1;font-family:inherit}body{background-color:#fff;margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:18px;color:#404040}#m{max-width:750px;margin:30px auto 10px;border:solid 1px #BABABA;background:#FFF;border-radius:7px;box-shadow:0 0 10px #D2D1D1}#m>*{padding:20px}h1{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:30px;font-weight:700;margin-bottom:20px;color:#444;text-decoration:none;border-bottom:1px solid #AFAFAF}a{color:#404040;text-decoration:none}.i{margin:20px;border-radius:7px;text-align:justify}.w{background:#FEFDCE;border:solid 1px #FFC643}.e{background:#FFE7E7;border:solid 1px #FE7171}#f{text-align:center;color:#969393}form,p,h1{text-align:center}form{margin-bottom:20px}ul{list-style:square;margin:0 0 0 20px}.i strong{margin:0 0 5px;display:block}header{margin-bottom:60px}header a{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);font-size:15px;font-weight:700}header h3 a,header .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;color:#fff;font-size:20px;font-weight:200;line-height:1}header p{margin:0;line-height:40px}header .fill{border-bottom:1px solid #E4E4E4;padding:20px 0;max-width:940px;margin:0 auto}div.container img.logo{margin-top:6px}.container{width:100%;max-width:940px;margin-left:auto;margin-right:auto;zoom:1}.alert-message{position:relative;background:#FFF;border:1px solid #E4E4E4;border-radius:7px;padding:20px 38px;margin-bottom:18px}.alert-message.error{border-color:#DD4B39;color:#DD4B39}.alert-message.warning{border-color:#DD4B39;color:#DD4B39}#l{height:80px;width:80px;margin:0 auto 20px;-webkit-animation:r 1s infinite linear;-moz-animation:r 1s infinite linear;-o-animation:r 1s infinite linear;animation:r 1s infinite linear;border-left:7px solid #EAF1FF;border-right:7px solid #EAF1FF;border-bottom:7px solid #EAF1FF;border-top:7px solid #2450AD;border-radius:100%}@-webkit-keyframes r{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-moz-keyframes r{from{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-o-keyframes r{from{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@keyframes r{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}p{margin-bottom:20px}.footer{border-top:1px solid #DDD;padding:10.8px 12px;font-size:12px;color:#818198}.footer a{color:#818198;float:right}.heading{text-align:left}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<object class="logo" data="tlt_networks_logo.svg" type="image/svg+xml"></object>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div id="maincontent" class="container">
|
||||
<h1 class="heading">FIRMWARE UPDATE</h1>
|
||||
<p>You are going to update <strong>firmware</strong> on the device.<br>Please, choose file from your local hard
|
||||
drive and click <strong>Update firmware</strong> button.</p>
|
||||
<form method="post" enctype="multipart/form-data"><input type="file" name="firmware"><input class="cbi-button"
|
||||
type="submit" value="Update firmware"></form>
|
||||
<div class="alert-message warning">
|
||||
<strong>WARNINGS</strong>
|
||||
<ul>
|
||||
<li>do not power off the device during update</li>
|
||||
<li>if everything goes well, the device will restart</li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer">
|
||||
Teltonika solutions<a href="https://teltonika-networks.com/">www.teltonika-networks.com</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
1
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/style.css
vendored
Normal file
1
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/style.css
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
html,body{margin:0;padding:0}h1,h2,p,a,img,strong,li,ol,ul,form,label,button,tr,th,td{margin:0;padding:0;border:0;font-weight:400;font-style:normal;font-size:100%;line-height:1;font-family:inherit}body{background-color:#fff;margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:18px;color:#404040}#m{max-width:750px;margin:30px auto 10px;border:solid 1px #BABABA;background:#FFF;border-radius:7px;box-shadow:0 0 10px #D2D1D1}#m>*{padding:20px}h1{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:30px;font-weight:700;margin-bottom:20px;color:#444;text-decoration:none;border-bottom:1px solid #AFAFAF}a{color:#404040;text-decoration:none}.i{margin:20px;border-radius:7px;text-align:justify}.w{background:#FEFDCE;border:solid 1px #FFC643}.e{background:#FFE7E7;border:solid 1px #FE7171}#f{text-align:center;color:#969393}form,p,h1{text-align:center}form{margin-bottom:20px}ul{list-style:square;margin:0 0 0 20px}.i strong{margin:0 0 5px;display:block}header{margin-bottom:60px}header a{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);font-size:15px;font-weight:700}header h3 a,header .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;color:#fff;font-size:20px;font-weight:200;line-height:1}header p{margin:0;line-height:40px}header .fill{border-bottom:1px solid #E4E4E4;padding:20px 0;max-width:940px;margin:0 auto}div.container img.logo{margin-top:6px}.container{width:100%;max-width:940px;margin-left:auto;margin-right:auto;zoom:1}.alert-message{position:relative;background:#FFF;border:1px solid #E4E4E4;border-radius:7px;padding:20px 38px;margin-bottom:18px}.alert-message.error{border-color:#DD4B39;color:#DD4B39}.alert-message.warning{border-color:#DD4B39;color:#DD4B39}#l{height:80px;width:80px;margin:0 auto 20px;-webkit-animation:r 1s infinite linear;-moz-animation:r 1s infinite linear;-o-animation:r 1s infinite linear;animation:r 1s infinite linear;border-left:7px solid #EAF1FF;border-right:7px solid #EAF1FF;border-bottom:7px solid #EAF1FF;border-top:7px solid #2450AD;border-radius:100%}@-webkit-keyframes r{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-moz-keyframes r{from{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-o-keyframes r{from{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@keyframes r{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}p{margin-bottom:20px}.footer{border-top:1px solid #DDD;padding:10.8px 12px;font-size:12px;color:#818198}.footer a{color:#818198;float:right}.heading{text-align:left}
|
||||
52
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/tlt_networks_logo.svg
vendored
Normal file
52
common/package/boot/uboot-ipq40xx/src/httpd/vendors/teltonika/tlt_networks_logo.svg
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg width="266.3" height="31" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 266.3 31" style="enable-background:new 0 0 266.3 31;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#0656A5;}
|
||||
.st1{fill:#0455A4;}
|
||||
.st2{fill:#0B56A3;}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0" d="M53.9,17.8L53.1,20h7.4l-1.1,3.4h-12l4.6-14h11.7l-1.1,3.4h-7.1l-0.6,1.9h6l-1.1,3.2H53.9z M32.8,21.8l4.5,4.5
|
||||
l-4.5,4.5l-4.5-4.5l0,0L17.5,15.6l0,0l0,0l6.2-6.4l-3.6-3.5l-9.8,10.1l9.9,9.9l3.7-3.7l4.5,4.5L23.9,31l-4.4-4.4l-4.2,4.2l-4.5-4.5
|
||||
l0,0L0,15.5l0,0l0,0L10.6,4.6l0,0L15,0l4.6,4.4l4.1-4.2l4.5,4.4l4.4-4.5l4.6,4.4l-4.4,4.6l-3.7-3.6l-9.8,10.1l9.9,9.9L32.8,21.8z
|
||||
M15.2,9l-3.7-3.6L1.7,15.5l9.9,9.9l3.4-3.4l-6.3-6.3l0,0l0,0L15.2,9z M70.8,9.4h-4.5l-4.6,14h11.1l1.2-3.7h-6.6L70.8,9.4z
|
||||
M50.4,9.4H36.7l-1.2,3.7h4.6l-3.4,10.4h4.5l3.4-10.4h4.5L50.4,9.4z M117.8,9.4l-2.2,6.6c-0.2,0.6-0.3,1.2-0.4,1.7l0,0.2l-0.2-1.1
|
||||
c0-0.2,0-0.3,0-0.5c0-0.2,0-0.3-0.1-0.4l-2-6.5h-4.3l-4.6,14h4.3l2.1-6.6c0.2-0.6,0.3-1.2,0.4-1.7l0-0.2c0.1,0.3,0.1,0.5,0.2,0.8
|
||||
c0.1,0.8,0.2,1.2,0.2,1.2l2,6.5h4.3l4.6-14H117.8z M153.6,23.4l0-1.9h-5.3l-1.2,1.9h-3.7l-0.3-0.7l9.5-13.4h4.6l0.8,14H153.6z
|
||||
M153.7,18.6l-0.1-4.9l-3.3,4.9H153.7z M147.3,9.4h-5.5l-6.3,4.6l1.5-4.6h-4.5l-4.6,14h4.5l1.5-4.5l1.9-1.2l2.1,5.6h4.8l0.5-0.7
|
||||
l-3.1-8.2L147.3,9.4z M104.3,15.6c-0.1,0.2-0.1,0.5-0.3,0.8c-0.8,2.3-2,4.1-3.8,5.4c-1.7,1.3-3.8,2-6.1,2c-2,0-3.4-0.5-4.4-1.5
|
||||
c-1-1-1.3-2.4-1-4.2c0.1-0.5,0.2-1,0.4-1.6c0.7-2.2,2-4,3.8-5.4c1.8-1.3,3.8-2,6.1-2c2,0,3.4,0.5,4.4,1.5c1,1,1.3,2.4,1,4.2
|
||||
C104.4,15.1,104.4,15.4,104.3,15.6 M99.9,15.1c0.1-0.8,0.1-1.4-0.2-1.8c-0.3-0.5-0.9-0.7-1.7-0.7c-1.1,0-2,0.4-2.7,1.2
|
||||
c-0.6,0.6-1,1.5-1.4,2.7c-0.1,0.2-0.1,0.4-0.2,0.7c-0.1,0.2-0.1,0.5-0.1,0.7c-0.1,0.8-0.1,1.4,0.2,1.8c0.3,0.5,0.9,0.7,1.7,0.7
|
||||
c1.1,0,1.9-0.4,2.7-1.2c0.6-0.6,1.1-1.5,1.5-2.7C99.7,15.9,99.8,15.4,99.9,15.1 M125,9.4l-4.6,14h4.6l4.6-14H125z M90.5,9.4H76.9
|
||||
l-1.2,3.7h4.6l-3.4,10.4h4.5l3.4-10.4h4.5L90.5,9.4z"/>
|
||||
<rect x="169.6" y="9.3" class="st1" width="1.5" height="14.1"/>
|
||||
<g>
|
||||
<path class="st2" d="M181.2,23.4V9.5h2.7l5.7,9.3V9.5h2.6v13.9h-2.8l-5.6-9.1v9.1H181.2z"/>
|
||||
<path class="st2" d="M201,20.2l2.7,0.5c-0.3,0.9-0.9,1.7-1.6,2.2c-0.8,0.5-1.8,0.8-2.8,0.8c-1.5,0.1-3-0.5-3.9-1.7
|
||||
c-0.7-1-1.1-2.2-1-3.5c-0.1-1.4,0.4-2.8,1.3-3.9c0.8-0.9,2.1-1.5,3.3-1.4c1.3-0.1,2.7,0.5,3.5,1.5c1,1.3,1.4,2.9,1.2,4.6h-6.6
|
||||
c0,0.7,0.2,1.3,0.6,1.8c0.4,0.4,1,0.7,1.5,0.7c0.4,0,0.7-0.1,1-0.3C200.7,21,200.9,20.6,201,20.2z M201.2,17.5
|
||||
c0-0.6-0.2-1.3-0.6-1.8c-0.7-0.8-1.9-0.8-2.7-0.1c0,0-0.1,0.1-0.1,0.1c-0.4,0.5-0.6,1.1-0.6,1.8H201.2z"/>
|
||||
<path class="st2" d="M210.6,13.3v2.1h-1.8v4.1c0,0.5,0,1,0.1,1.4c0,0.1,0.1,0.3,0.2,0.3c0.1,0.1,0.3,0.2,0.5,0.2
|
||||
c0.4,0,0.7-0.1,1-0.3l0.2,2.1c-0.7,0.3-1.4,0.4-2.1,0.4c-0.4,0-0.9-0.1-1.3-0.2c-0.3-0.1-0.6-0.3-0.8-0.6c-0.2-0.3-0.3-0.7-0.4-1
|
||||
c-0.1-0.6-0.1-1.3-0.1-1.9v-4.4h-1.3v-2.1h1.2v-2l2.7-1.5v3.5H210.6z"/>
|
||||
<path class="st2" d="M214.3,23.4l-3.2-10.1h2.6l1.9,6.6l1.7-6.6h2.6l1.7,6.6l1.9-6.6h2.6L223,23.4h-2.6l-1.7-6.5l-1.7,6.5H214.3z"
|
||||
/>
|
||||
<path class="st2" d="M227,18.2c0-0.9,0.2-1.8,0.7-2.6c0.4-0.8,1.1-1.5,1.9-1.9c0.8-0.4,1.7-0.7,2.7-0.7c1.4-0.1,2.8,0.5,3.7,1.5
|
||||
c1,1,1.5,2.4,1.5,3.8c0,1.4-0.5,2.8-1.5,3.8c-1,1-2.3,1.5-3.7,1.5c-0.9,0-1.8-0.2-2.6-0.6c-0.8-0.4-1.5-1-1.9-1.8
|
||||
C227.2,20.2,226.9,19.2,227,18.2z M229.7,18.3c-0.1,0.8,0.2,1.6,0.7,2.3c0.8,1,2.3,1.1,3.3,0.2c0.1-0.1,0.2-0.2,0.2-0.2
|
||||
c0.5-0.7,0.8-1.5,0.7-2.3c0.1-0.8-0.2-1.6-0.7-2.3c-0.8-1-2.3-1.1-3.3-0.2c-0.1,0.1-0.1,0.1-0.2,0.2
|
||||
C229.9,16.7,229.6,17.5,229.7,18.3z"/>
|
||||
<path class="st2" d="M242,23.4h-2.7V13.3h2.5v1.4c0.3-0.5,0.7-1,1.1-1.3c0.3-0.2,0.7-0.3,1.2-0.3c0.6,0,1.2,0.2,1.8,0.5l-0.8,2.3
|
||||
c-0.4-0.3-0.8-0.4-1.2-0.4c-0.3,0-0.7,0.1-0.9,0.3c-0.3,0.3-0.5,0.7-0.6,1.1c-0.2,1.1-0.3,2.3-0.2,3.4V23.4z"/>
|
||||
<path class="st2" d="M246.9,23.4V9.5h2.7v7.4l3.1-3.5h3.3l-3.4,3.7l3.7,6.4h-2.9l-2.6-4.5l-1.2,1.3v3.2H246.9z"/>
|
||||
<path class="st2" d="M256.9,20.5l2.7-0.4c0.1,0.5,0.3,0.9,0.7,1.2c0.4,0.3,0.9,0.4,1.5,0.4c0.5,0,1.1-0.1,1.6-0.4
|
||||
c0.2-0.2,0.4-0.4,0.4-0.7c0-0.2-0.1-0.4-0.2-0.5c-0.3-0.2-0.6-0.3-0.9-0.4c-1.4-0.2-2.8-0.7-4.1-1.3c-0.8-0.5-1.2-1.4-1.2-2.3
|
||||
c0-0.9,0.4-1.7,1-2.2c0.9-0.7,2.1-1,3.2-0.9c1.1-0.1,2.2,0.2,3.1,0.7c0.7,0.5,1.2,1.2,1.4,2l-2.5,0.5c-0.1-0.4-0.3-0.7-0.6-0.9
|
||||
c-0.4-0.2-0.8-0.4-1.3-0.3c-0.5,0-1,0.1-1.5,0.3c-0.2,0.1-0.3,0.3-0.3,0.5c0,0.2,0.1,0.4,0.3,0.5c0.8,0.4,1.6,0.6,2.5,0.8
|
||||
c1.1,0.2,2.1,0.5,3,1.1c0.6,0.5,0.9,1.2,0.8,2c0,0.9-0.4,1.8-1.2,2.4c-1,0.7-2.2,1.1-3.4,1c-1.1,0.1-2.3-0.2-3.3-0.8
|
||||
C257.7,22.3,257.1,21.4,256.9,20.5z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.5 KiB |
BIN
common/package/boot/uboot-ipq40xx/src/httpd/vendors/yuicompressor-2.4.8.jar
vendored
Normal file
BIN
common/package/boot/uboot-ipq40xx/src/httpd/vendors/yuicompressor-2.4.8.jar
vendored
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue