mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
src/system/mtdutils: Add files from mtd-utils
- based on mtd-utils http://git.infradead.org/mtd-utils.git
commit ab8c6fb93ce9db0f09401c4b819b0b277dc00340 (2013-07-01)
- Add files for create jffs2 image and using sumtool
- Creating classes for mkfs.jffs2 and sumtool
Origin commit data
------------------
Commit: d8957d17ac
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-09-01 (Sun, 01 Sep 2013)
Origin message was:
------------------
src/system/mtdutils: Add files from mtd-utils
- based on mtd-utils http://git.infradead.org/mtd-utils.git
commit ab8c6fb93ce9db0f09401c4b819b0b277dc00340 (2013-07-01)
- Add files for create jffs2 image and using sumtool
- Creating classes for mkfs.jffs2 and sumtool
This commit is contained in:
54
src/system/mtdutils/mcast_image.h
Normal file
54
src/system/mtdutils/mcast_image.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#define PKT_SIZE 2820
|
||||
|
||||
struct image_pkt_hdr {
|
||||
uint32_t resend;
|
||||
uint32_t totcrc;
|
||||
uint32_t nr_blocks;
|
||||
uint32_t blocksize;
|
||||
uint32_t block_crc;
|
||||
uint32_t block_nr;
|
||||
uint32_t pkt_sequence;
|
||||
uint16_t pkt_nr;
|
||||
uint16_t nr_pkts;
|
||||
uint32_t thislen;
|
||||
uint32_t thiscrc;
|
||||
};
|
||||
|
||||
struct image_pkt {
|
||||
struct image_pkt_hdr hdr;
|
||||
unsigned char data[PKT_SIZE];
|
||||
};
|
||||
|
||||
struct fec_parms;
|
||||
|
||||
/* k - number of actual data packets
|
||||
* n - total number of packets including data and redundant packets
|
||||
* (actual packet size isn't relevant here) */
|
||||
struct fec_parms *fec_new(int k, int n);
|
||||
void fec_free(struct fec_parms *p);
|
||||
|
||||
/* src - array of (n) pointers to data packets
|
||||
* fec - buffer for packet to be generated
|
||||
* index - index of packet to be generated (0 <= index < n)
|
||||
* sz - data packet size
|
||||
*
|
||||
* _linear version just takes a pointer to the raw data; no
|
||||
* mucking about with packet pointers.
|
||||
*/
|
||||
void fec_encode(struct fec_parms *code, unsigned char *src[],
|
||||
unsigned char *fec, int index, int sz);
|
||||
void fec_encode_linear(struct fec_parms *code, unsigned char *src,
|
||||
unsigned char *fec, int index, int sz);
|
||||
|
||||
/* data - array of (k) pointers to data packets, in arbitrary order (see i)
|
||||
* i - indices of (data) packets
|
||||
* sz - data packet size
|
||||
*
|
||||
* Will never fail as long as you give it (k) individual data packets.
|
||||
* Will re-order the (data) pointers but not the indices -- data packets
|
||||
* are ordered on return.
|
||||
*/
|
||||
int fec_decode(struct fec_parms *code, unsigned char *data[],
|
||||
int i[], int sz);
|
Reference in New Issue
Block a user