10 #ifndef TOR_CONSDIFF_H
11 #define TOR_CONSDIFF_H
16 const char *cons2,
size_t cons2len);
18 const char *diff,
size_t diff_len);
22 #ifdef CONSDIFF_PRIVATE
30 typedef struct cdline_t {
35 typedef struct consensus_digest_t {
41 const consensus_digest_t *digests1,
42 const consensus_digest_t *digests2,
46 const consensus_digest_t *digests1);
52 typedef struct smartlist_slice_t {
75 const smartlist_slice_t *slice2,
82 const cdline_t *
string);
84 const smartlist_slice_t *slice1,
85 const smartlist_slice_t *slice2);
87 const char *s,
size_t len,
96 consensus_digest_t *digest_out));
99 consensus_digest_t *digest_out));
Implements a variable-sized (but non-resizeable) bit-array.
STATIC void smartlist_add_linecpy(smartlist_t *lst, memarea_t *area, const char *s)
STATIC int line_str_eq(const cdline_t *a, const char *b)
STATIC void trim_slices(smartlist_slice_t *slice1, smartlist_slice_t *slice2)
STATIC int * lcs_lengths(const smartlist_slice_t *slice1, const smartlist_slice_t *slice2, int direction)
STATIC void set_changed(bitarray_t *changed1, bitarray_t *changed2, const smartlist_slice_t *slice1, const smartlist_slice_t *slice2)
STATIC smartlist_t * apply_ed_diff(const smartlist_t *cons1, const smartlist_t *diff, int diff_starting_line)
smartlist_t * consdiff_gen_diff(const smartlist_t *cons1, const smartlist_t *cons2, const consensus_digest_t *digests1, const consensus_digest_t *digests2, memarea_t *area)
STATIC int consensus_digest_eq(const uint8_t *d1, const uint8_t *d2)
STATIC int base64cmp(const cdline_t *hash1, const cdline_t *hash2)
STATIC int next_router(const smartlist_t *cons, int cur)
STATIC smartlist_slice_t * smartlist_slice(const smartlist_t *list, int start, int end)
STATIC void calc_changes(smartlist_slice_t *slice1, smartlist_slice_t *slice2, bitarray_t *changed1, bitarray_t *changed2)
STATIC int consensus_compute_digest_as_signed(const char *cons, size_t len, consensus_digest_t *digest_out)
STATIC int is_valid_router_entry(const cdline_t *line)
char * consdiff_apply_diff(const smartlist_t *cons1, const smartlist_t *diff, const consensus_digest_t *digests1)
STATIC int consensus_split_lines(smartlist_t *out, const char *s, size_t len, memarea_t *area)
STATIC smartlist_t * gen_ed_diff(const smartlist_t *cons1_orig, const smartlist_t *cons2, memarea_t *area)
STATIC int get_id_hash(const cdline_t *line, cdline_t *hash_out)
STATIC int lines_eq(const cdline_t *a, const cdline_t *b)
STATIC int smartlist_slice_string_pos(const smartlist_slice_t *slice, const cdline_t *string)
int consdiff_get_digests(const smartlist_t *diff, char *digest1_out, char *digest2_out)
STATIC int consensus_compute_digest(const char *cons, size_t len, consensus_digest_t *digest_out)
char * consensus_diff_apply(const char *consensus, size_t consensus_len, const char *diff, size_t diff_len)
char * consensus_diff_generate(const char *cons1, size_t cons1len, const char *cons2, size_t cons2len)
int looks_like_a_consensus_diff(const char *document, size_t len)
Master header file for Tor-specific functionality.
#define MOCK_DECL(rv, funcname, arglist)