X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=fwimage.h;fp=fwimage.h;h=52dcfb1bacc07f553341ba21e660388c8dfe5f12;hb=a7dc0526f81997fbdc27109452a8e4e519c4b69a;hp=0000000000000000000000000000000000000000;hpb=b0499167243e867d8b4648cbf800548557ddb2b2;p=project%2Ffwtool.git diff --git a/fwimage.h b/fwimage.h new file mode 100644 index 0000000..52dcfb1 --- /dev/null +++ b/fwimage.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2016 Felix Fietkau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#ifndef __FWIMAGE_H +#define __FWIMAGE_H + +#include + +#define FWIMAGE_MAGIC 0x46577830 /* FWx0 */ + +struct fwimage_header { + uint32_t version; + uint32_t flags; + char data[]; +}; + +struct fwimage_trailer { + uint32_t magic; + uint32_t crc32; + uint8_t type; + uint8_t __pad[3]; + uint32_t size; +}; + +enum fwimage_type { + FWIMAGE_SIGNATURE, + FWIMAGE_INFO, +}; + +#endif