Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fec(3) [debian man page]

FEC(3)							   BSD Library Functions Manual 						    FEC(3)

NAME
fec_new, fec_encode, fec_encode, fec_free -- An erasure code in GF(2^m) SYNOPSIS
#include <fec.h> void * fec_new(int k, int n); void fec_encode(void *code, void *data[], void *dst, int i, int sz); int fec_decode(void *code, void *data[], int i[], int sz); void * fec_free(void *code); DESCRIPTION
This library implements a simple (n,k) erasure code based on Vandermonde matrices. The encoder takes k packets of size sz each, and is able to produce up to n different encoded packets, numbered from 0 to n-1, such that any subset of k of them permits reconstruction of the origi- nal data. The data structures necessary for the encoding/decoding must first be created using calling fec_new() with the desired parameters. The code descriptor returned by the function must be passed to other functions, and destroyed calling fec_free() Allowed values for k and n depend on a compile-time value of GF_BITS and must be k <= n <= 2^GF_BITS. Best performance is achieved with GF_BITS=8, although the code supports also GF_BITS=16. Encoding is done by calling fec_encode() and passing it pointers to the code descriptor, the source and destination data packets, the index of the packet to be produced, and the size of the packet. fec_decode() with pointers to the code, received packets, indexes of received packets, and packet size. Decoding is done in place, possibly shuffling the arrays passed as parameters. Decoding is deterministic as long as the received packets are different. The decoding procedure does some limited testing on this and returns if parameters are invalid. EXAMPLE
#include <fec.h> /* * example of sender code */ void *code ; int n, k ; void *src[] ; void *pkt ; code = new_code (k, n ); for (i = 0 ; i < k ; i++ ) src[i] = .. pointer to i-th source packet .. for (each packet to transmit) { i = ... index of the packet ; fec_encode(code, src, pkt, i, size) ; .. use packet in pkt } fec_free(code) ; /* * example of receiver code */ void *code ; int n, k ; void *data[] ; int *ix[] ; code = new_code (k, n ); for (i = 0 ; i < k ; i++ ) { ... receive a new packet ... data[i] = .. pointer to i-th source packet .. ix[i] = .. index of i-th source packet .. } fec_decode(code, data, ix, size) ; /* * now data[] has pointers to the source packets */ Please direct bug reports to luigi@iet.unipi.it . BSD
July 15, 1998 BSD

Check Out this Related Man Page

ldns(3) 						     Library Functions Manual							   ldns(3)

NAME
ldns_pkt_edns, ldns_pkt_edns_udp_size, ldns_pkt_edns_extended_rcode, ldns_pkt_edns_version, ldns_pkt_edns_z, ldns_pkt_edns_data, ldns_pkt_set_edns_udp_size, ldns_pkt_set_edns_extended_rcode, ldns_pkt_set_edns_version, ldns_pkt_set_edns_z, ldns_pkt_set_edns_data- SYNOPSIS
#include <stdint.h> #include <stdbool.h> #include <ldns/ldns.h> bool ldns_pkt_edns(const ldns_pkt *packet); uint16_t ldns_pkt_edns_udp_size(const ldns_pkt *packet); uint8_t ldns_pkt_edns_extended_rcode(const ldns_pkt *packet); uint8_t ldns_pkt_edns_version(const ldns_pkt *packet); uint16_t ldns_pkt_edns_z(const ldns_pkt *packet); ldns_rdf* ldns_pkt_edns_data(const ldns_pkt *packet); void ldns_pkt_set_edns_udp_size(ldns_pkt *packet, uint16_t s); void ldns_pkt_set_edns_extended_rcode(ldns_pkt *packet, uint8_t c); void ldns_pkt_set_edns_version(ldns_pkt *packet, uint8_t v); void ldns_pkt_set_edns_z(ldns_pkt *packet, uint16_t z); void ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data); DESCRIPTION
ldns_pkt_edns() returns true if this packet needs and EDNS rr to be sent. At the moment the only reason is an expected packet size larger than 512 bytes, but for instance dnssec would be a good reason too. packet: the packet to check Returns true if packet needs edns rr ldns_pkt_edns_udp_size() return the packet's edns udp size packet: the packet Returns the size ldns_pkt_edns_extended_rcode() return the packet's edns extended rcode packet: the packet Returns the rcode ldns_pkt_edns_version() return the packet's edns version packet: the packet Returns the version ldns_pkt_edns_z() return the packet's edns z value packet: the packet Returns the z value ldns_pkt_edns_data() return the packet's edns data packet: the packet Returns the data ldns_pkt_set_edns_udp_size() Set the packet's edns udp size packet: the packet s: the size ldns_pkt_set_edns_extended_rcode() Set the packet's edns extended rcode packet: the packet c: the code ldns_pkt_set_edns_version() Set the packet's edns version packet: the packet v: the version ldns_pkt_set_edns_z() Set the packet's edns z value packet: the packet z: the value ldns_pkt_set_edns_data() Set the packet's edns data packet: the packet data: the data AUTHOR
The ldns team at NLnet Labs. Which consists out of Jelte Jansen and Miek Gieben. REPORTING BUGS
Please report bugs to ldns-team@nlnetlabs.nl or in our bugzilla at http://www.nlnetlabs.nl/bugs/index.html COPYRIGHT
Copyright (c) 2004 - 2006 NLnet Labs. Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
ldns_pkt. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. REMARKS
This manpage was automaticly generated from the ldns source code by use of Doxygen and some perl. 30 May 2006 ldns(3)
Man Page