diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/ipcomp.c linux-2.4.34-wt1.wtap/net/ipsec/ipcomp.c --- linux-2.4.34-wt1/net/ipsec/ipcomp.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/ipcomp.c 2007-02-18 12:14:13 +0100 @@ -92,7 +92,7 @@ struct iphdr *iph; unsigned int iphlen, pyldsz, cpyldsz; unsigned char *buffer; - z_stream zs; + ipcomp_z_stream zs; int zresult; KLIPS_PRINT(sysctl_ipsec_debug_ipcomp, @@ -183,9 +183,9 @@ /* We want to use deflateInit2 because we don't want the adler header. */ - zresult = deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -11, - DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); - if (zresult != Z_OK) { + zresult = deflateInit2(&zs, IPCOMP_Z_DEFAULT_COMPRESSION, IPCOMP_Z_DEFLATED, -11, + DEF_MEM_LEVEL, IPCOMP_Z_DEFAULT_STRATEGY); + if (zresult != IPCOMP_Z_OK) { KLIPS_PRINT(sysctl_ipsec_debug_ipcomp, "klips_error:skb_compress: " "deflateInit2() returned error %d (%s), " @@ -245,11 +245,11 @@ zs.avail_out = cpyldsz; /* Finish compression in one step */ - zresult = deflate(&zs, Z_FINISH); + zresult = deflate(&zs, IPCOMP_Z_FINISH); /* Free all dynamically allocated buffers */ deflateEnd(&zs); - if (zresult != Z_STREAM_END) { + if (zresult != IPCOMP_Z_STREAM_END) { *flags |= IPCOMP_UNCOMPRESSABLE; kfree(buffer); @@ -347,7 +347,7 @@ /* original ip header */ struct iphdr *oiph, *iph; unsigned int iphlen, pyldsz, cpyldsz; - z_stream zs; + ipcomp_z_stream zs; int zresult; KLIPS_PRINT(sysctl_ipsec_debug_ipcomp, @@ -442,7 +442,7 @@ /* We want to use inflateInit2 because we don't want the adler header. */ zresult = inflateInit2(&zs, -15); - if (zresult != Z_OK) { + if (zresult != IPCOMP_Z_OK) { KLIPS_PRINT(sysctl_ipsec_debug_ipcomp, "klips_error:skb_decompress: " "inflateInit2() returned error %d (%s), " @@ -520,21 +520,21 @@ zs.next_out = (char *)iph + iphlen; zs.avail_out = pyldsz; - zresult = inflate(&zs, Z_SYNC_FLUSH); + zresult = inflate(&zs, IPCOMP_Z_SYNC_FLUSH); /* work around a bug in zlib, which sometimes wants to taste an extra * byte when being used in the (undocumented) raw deflate mode. */ - if (zresult == Z_OK && !zs.avail_in && zs.avail_out) { + if (zresult == IPCOMP_Z_OK && !zs.avail_in && zs.avail_out) { __u8 zerostuff = 0; zs.next_in = &zerostuff; zs.avail_in = 1; - zresult = inflate(&zs, Z_FINISH); + zresult = inflate(&zs, IPCOMP_Z_FINISH); } inflateEnd(&zs); - if (zresult != Z_STREAM_END) { + if (zresult != IPCOMP_Z_STREAM_END) { KLIPS_PRINT(sysctl_ipsec_debug_ipcomp, "klips_error:skb_decompress: " "inflate() returned error %d (%s), " diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/adler32.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/adler32.c --- linux-2.4.34-wt1/net/ipsec/zlib/adler32.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/adler32.c 2007-02-18 12:23:51 +0100 @@ -18,7 +18,7 @@ #define DO16(buf) DO8(buf,0); DO8(buf,8); /* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) +uLong IPCOMP_ZEXPORT adler32(adler, buf, len) uLong adler; const Bytef *buf; uInt len; @@ -27,7 +27,7 @@ unsigned long s2 = (adler >> 16) & 0xffff; int k; - if (buf == Z_NULL) return 1L; + if (buf == IPCOMP_Z_NULL) return 1L; while (len > 0) { k = len < NMAX ? len : NMAX; diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/deflate.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/deflate.c --- linux-2.4.34-wt1/net/ipsec/zlib/deflate.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/deflate.c 2007-02-18 12:23:52 +0100 @@ -79,8 +79,8 @@ local block_state deflate_slow OF((deflate_state *s, int flush)); local void lm_init OF((deflate_state *s)); local void putShortMSB OF((deflate_state *s, uInt b)); -local void flush_pending OF((z_streamp strm)); -local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); +local void flush_pending OF((ipcomp_z_streamp strm)); +local int read_buf OF((ipcomp_z_streamp strm, Bytef *buf, unsigned size)); #ifdef ASMV void match_init OF((void)); /* asm code initialization */ uInt longest_match OF((deflate_state *s, IPos cur_match)); @@ -187,21 +187,21 @@ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); /* ========================================================================= */ -int ZEXPORT deflateInit_(strm, level, version, stream_size) - z_streamp strm; +int IPCOMP_ZEXPORT deflateInit_(strm, level, version, stream_size) + ipcomp_z_streamp strm; int level; const char *version; int stream_size; { - return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, - Z_DEFAULT_STRATEGY, version, stream_size); + return deflateInit2_(strm, level, IPCOMP_Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, + IPCOMP_Z_DEFAULT_STRATEGY, version, stream_size); /* To do: ignore strm->next_in if we use it as window */ } /* ========================================================================= */ -int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, +int IPCOMP_ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, version, stream_size) - z_streamp strm; + ipcomp_z_streamp strm; int level; int method; int windowBits; @@ -212,28 +212,28 @@ { deflate_state *s; int noheader = 0; - static const char* my_version = ZLIB_VERSION; + static const char* my_version = IPCOMP_ZLIB_VERSION; ushf *overlay; /* We overlay pending_buf and d_buf+l_buf. This works since the average * output size for (length,distance) codes is <= 24 bits. */ - if (version == Z_NULL || version[0] != my_version[0] || - stream_size != sizeof(z_stream)) { - return Z_VERSION_ERROR; - } - if (strm == Z_NULL) return Z_STREAM_ERROR; - - strm->msg = Z_NULL; - if (strm->zalloc == Z_NULL) { - return Z_STREAM_ERROR; + if (version == IPCOMP_Z_NULL || version[0] != my_version[0] || + stream_size != sizeof(ipcomp_z_stream)) { + return IPCOMP_Z_VERSION_ERROR; + } + if (strm == IPCOMP_Z_NULL) return IPCOMP_Z_STREAM_ERROR; + + strm->msg = IPCOMP_Z_NULL; + if (strm->zalloc == IPCOMP_Z_NULL) { + return IPCOMP_Z_STREAM_ERROR; /* strm->zalloc = zcalloc; strm->opaque = (voidpf)0;*/ } - if (strm->zfree == Z_NULL) return Z_STREAM_ERROR; /* strm->zfree = zcfree; */ + if (strm->zfree == IPCOMP_Z_NULL) return IPCOMP_Z_STREAM_ERROR; /* strm->zfree = zcfree; */ - if (level == Z_DEFAULT_COMPRESSION) level = 6; + if (level == IPCOMP_Z_DEFAULT_COMPRESSION) level = 6; #ifdef FASTEST level = 1; #endif @@ -242,14 +242,14 @@ noheader = 1; windowBits = -windowBits; } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != IPCOMP_Z_DEFLATED || windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_HUFFMAN_ONLY) { - return Z_STREAM_ERROR; + strategy < 0 || strategy > IPCOMP_Z_HUFFMAN_ONLY) { + return IPCOMP_Z_STREAM_ERROR; } - s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); - if (s == Z_NULL) return Z_MEM_ERROR; - strm->state = (struct internal_state FAR *)s; + s = (deflate_state *) IPCOMP_ZALLOC(strm, 1, sizeof(deflate_state)); + if (s == IPCOMP_Z_NULL) return IPCOMP_Z_MEM_ERROR; + strm->state = (struct ipcomp_internal_state FAR *)s; s->strm = strm; s->noheader = noheader; @@ -262,21 +262,21 @@ s->hash_mask = s->hash_size - 1; s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); - s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); - s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); - s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); + s->window = (Bytef *) IPCOMP_ZALLOC(strm, s->w_size, 2*sizeof(Byte)); + s->prev = (Posf *) IPCOMP_ZALLOC(strm, s->w_size, sizeof(Pos)); + s->head = (Posf *) IPCOMP_ZALLOC(strm, s->hash_size, sizeof(Pos)); s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + overlay = (ushf *) IPCOMP_ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); s->pending_buf = (uchf *) overlay; s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); - if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || - s->pending_buf == Z_NULL) { - strm->msg = ERR_MSG(Z_MEM_ERROR); + if (s->window == IPCOMP_Z_NULL || s->prev == IPCOMP_Z_NULL || s->head == IPCOMP_Z_NULL || + s->pending_buf == IPCOMP_Z_NULL) { + strm->msg = ERR_MSG(IPCOMP_Z_MEM_ERROR); deflateEnd (strm); - return Z_MEM_ERROR; + return IPCOMP_Z_MEM_ERROR; } s->d_buf = overlay + s->lit_bufsize/sizeof(ush); s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; @@ -289,8 +289,8 @@ } /* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) - z_streamp strm; +int IPCOMP_ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) + ipcomp_z_streamp strm; const Bytef *dictionary; uInt dictLength; { @@ -299,13 +299,13 @@ uInt n; IPos hash_head = 0; - if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL || - strm->state->status != INIT_STATE) return Z_STREAM_ERROR; + if (strm == IPCOMP_Z_NULL || strm->state == IPCOMP_Z_NULL || dictionary == IPCOMP_Z_NULL || + strm->state->status != INIT_STATE) return IPCOMP_Z_STREAM_ERROR; s = strm->state; strm->adler = adler32(strm->adler, dictionary, dictLength); - if (length < MIN_MATCH) return Z_OK; + if (length < MIN_MATCH) return IPCOMP_Z_OK; if (length > MAX_DIST(s)) { length = MAX_DIST(s); #ifndef USE_DICT_HEAD @@ -326,63 +326,63 @@ INSERT_STRING(s, n, hash_head); } if (hash_head) hash_head = 0; /* to make compiler happy */ - return Z_OK; + return IPCOMP_Z_OK; } /* ========================================================================= */ -int ZEXPORT deflateReset (strm) - z_streamp strm; +int IPCOMP_ZEXPORT deflateReset (strm) + ipcomp_z_streamp strm; { deflate_state *s; - if (strm == Z_NULL || strm->state == Z_NULL || - strm->zalloc == Z_NULL || strm->zfree == Z_NULL) return Z_STREAM_ERROR; + if (strm == IPCOMP_Z_NULL || strm->state == IPCOMP_Z_NULL || + strm->zalloc == IPCOMP_Z_NULL || strm->zfree == IPCOMP_Z_NULL) return IPCOMP_Z_STREAM_ERROR; strm->total_in = strm->total_out = 0; - strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ - strm->data_type = Z_UNKNOWN; + strm->msg = IPCOMP_Z_NULL; /* use zfree if we ever allocate msg dynamically */ + strm->data_type = IPCOMP_Z_UNKNOWN; s = (deflate_state *)strm->state; s->pending = 0; s->pending_out = s->pending_buf; if (s->noheader < 0) { - s->noheader = 0; /* was set to -1 by deflate(..., Z_FINISH); */ + s->noheader = 0; /* was set to -1 by deflate(..., IPCOMP_Z_FINISH); */ } s->status = s->noheader ? BUSY_STATE : INIT_STATE; strm->adler = 1; - s->last_flush = Z_NO_FLUSH; + s->last_flush = IPCOMP_Z_NO_FLUSH; _tr_init(s); lm_init(s); - return Z_OK; + return IPCOMP_Z_OK; } /* ========================================================================= */ -int ZEXPORT deflateParams(strm, level, strategy) - z_streamp strm; +int IPCOMP_ZEXPORT deflateParams(strm, level, strategy) + ipcomp_z_streamp strm; int level; int strategy; { deflate_state *s; compress_func func; - int err = Z_OK; + int err = IPCOMP_Z_OK; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm == IPCOMP_Z_NULL || strm->state == IPCOMP_Z_NULL) return IPCOMP_Z_STREAM_ERROR; s = strm->state; - if (level == Z_DEFAULT_COMPRESSION) { + if (level == IPCOMP_Z_DEFAULT_COMPRESSION) { level = 6; } - if (level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) { - return Z_STREAM_ERROR; + if (level < 0 || level > 9 || strategy < 0 || strategy > IPCOMP_Z_HUFFMAN_ONLY) { + return IPCOMP_Z_STREAM_ERROR; } func = configuration_table[s->level].func; if (func != configuration_table[level].func && strm->total_in != 0) { /* Flush the last buffer: */ - err = deflate(strm, Z_PARTIAL_FLUSH); + err = deflate(strm, IPCOMP_Z_PARTIAL_FLUSH); } if (s->level != level) { s->level = level; @@ -415,7 +415,7 @@ * (See also read_buf()). */ local void flush_pending(strm) - z_streamp strm; + ipcomp_z_streamp strm; { unsigned len = strm->state->pending; @@ -434,25 +434,25 @@ } /* ========================================================================= */ -int ZEXPORT deflate (strm, flush) - z_streamp strm; +int IPCOMP_ZEXPORT deflate (strm, flush) + ipcomp_z_streamp strm; int flush; { int old_flush; /* value of flush param for previous deflate call */ deflate_state *s; - if (strm == Z_NULL || strm->state == Z_NULL || - flush > Z_FINISH || flush < 0) { - return Z_STREAM_ERROR; + if (strm == IPCOMP_Z_NULL || strm->state == IPCOMP_Z_NULL || + flush > IPCOMP_Z_FINISH || flush < 0) { + return IPCOMP_Z_STREAM_ERROR; } s = strm->state; - if (strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0) || - (s->status == FINISH_STATE && flush != Z_FINISH)) { - ERR_RETURN(strm, Z_STREAM_ERROR); + if (strm->next_out == IPCOMP_Z_NULL || + (strm->next_in == IPCOMP_Z_NULL && strm->avail_in != 0) || + (s->status == FINISH_STATE && flush != IPCOMP_Z_FINISH)) { + ERR_RETURN(strm, IPCOMP_Z_STREAM_ERROR); } - if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); + if (strm->avail_out == 0) ERR_RETURN(strm, IPCOMP_Z_BUF_ERROR); s->strm = strm; /* just in case */ old_flush = s->last_flush; @@ -461,7 +461,7 @@ /* Write the zlib header */ if (s->status == INIT_STATE) { - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt header = (IPCOMP_Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; uInt level_flags = (s->level-1) >> 1; if (level_flags > 3) level_flags = 3; @@ -491,27 +491,27 @@ * return OK instead of BUF_ERROR at next call of deflate: */ s->last_flush = -1; - return Z_OK; + return IPCOMP_Z_OK; } /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUFF_ERROR. + * flushes. For repeated and useless calls with IPCOMP_Z_FINISH, we keep + * returning IPCOMP_Z_STREAM_END instead of Z_BUFF_ERROR. */ } else if (strm->avail_in == 0 && flush <= old_flush && - flush != Z_FINISH) { - ERR_RETURN(strm, Z_BUF_ERROR); + flush != IPCOMP_Z_FINISH) { + ERR_RETURN(strm, IPCOMP_Z_BUF_ERROR); } /* User must not provide more input after the first FINISH: */ if (s->status == FINISH_STATE && strm->avail_in != 0) { - ERR_RETURN(strm, Z_BUF_ERROR); + ERR_RETURN(strm, IPCOMP_Z_BUF_ERROR); } /* Start a new block or continue the current one. */ if (strm->avail_in != 0 || s->lookahead != 0 || - (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { + (flush != IPCOMP_Z_NO_FLUSH && s->status != FINISH_STATE)) { block_state bstate; bstate = (*(configuration_table[s->level].func))(s, flush); @@ -523,8 +523,8 @@ if (strm->avail_out == 0) { s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + return IPCOMP_Z_OK; + /* If flush != IPCOMP_Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an * empty block here, this will be done at next call. This also @@ -533,28 +533,28 @@ */ } if (bstate == block_done) { - if (flush == Z_PARTIAL_FLUSH) { + if (flush == IPCOMP_Z_PARTIAL_FLUSH) { _tr_align(s); } else { /* FULL_FLUSH or SYNC_FLUSH */ _tr_stored_block(s, (char*)0, 0L, 0); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ - if (flush == Z_FULL_FLUSH) { + if (flush == IPCOMP_Z_FULL_FLUSH) { CLEAR_HASH(s); /* forget history */ } } flush_pending(strm); if (strm->avail_out == 0) { s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; + return IPCOMP_Z_OK; } } } Assert(strm->avail_out > 0, "bug2"); - if (flush != Z_FINISH) return Z_OK; - if (s->noheader) return Z_STREAM_END; + if (flush != IPCOMP_Z_FINISH) return IPCOMP_Z_OK; + if (s->noheader) return IPCOMP_Z_STREAM_END; /* Write the zlib trailer (adler32) */ putShortMSB(s, (uInt)(strm->adler >> 16)); @@ -564,33 +564,33 @@ * to flush the rest. */ s->noheader = -1; /* write the trailer only once! */ - return s->pending != 0 ? Z_OK : Z_STREAM_END; + return s->pending != 0 ? IPCOMP_Z_OK : IPCOMP_Z_STREAM_END; } /* ========================================================================= */ -int ZEXPORT deflateEnd (strm) - z_streamp strm; +int IPCOMP_ZEXPORT deflateEnd (strm) + ipcomp_z_streamp strm; { int status; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm == IPCOMP_Z_NULL || strm->state == IPCOMP_Z_NULL) return IPCOMP_Z_STREAM_ERROR; status = strm->state->status; if (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) { - return Z_STREAM_ERROR; + return IPCOMP_Z_STREAM_ERROR; } /* Deallocate in reverse order of allocations: */ - TRY_FREE(strm, strm->state->pending_buf); - TRY_FREE(strm, strm->state->head); - TRY_FREE(strm, strm->state->prev); - TRY_FREE(strm, strm->state->window); + IPCOMP_TRY_FREE(strm, strm->state->pending_buf); + IPCOMP_TRY_FREE(strm, strm->state->head); + IPCOMP_TRY_FREE(strm, strm->state->prev); + IPCOMP_TRY_FREE(strm, strm->state->window); - ZFREE(strm, strm->state); - strm->state = Z_NULL; + IPCOMP_ZFREE(strm, strm->state); + strm->state = IPCOMP_Z_NULL; - return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; + return status == BUSY_STATE ? IPCOMP_Z_DATA_ERROR : IPCOMP_Z_OK; } /* ========================================================================= @@ -598,42 +598,42 @@ * To simplify the source, this is not supported for 16-bit MSDOS (which * doesn't have enough memory anyway to duplicate compression states). */ -int ZEXPORT deflateCopy (dest, source) - z_streamp dest; - z_streamp source; +int IPCOMP_ZEXPORT deflateCopy (dest, source) + ipcomp_z_streamp dest; + ipcomp_z_streamp source; { #ifdef MAXSEG_64K - return Z_STREAM_ERROR; + return IPCOMP_Z_STREAM_ERROR; #else deflate_state *ds; deflate_state *ss; ushf *overlay; - if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { - return Z_STREAM_ERROR; + if (source == IPCOMP_Z_NULL || dest == IPCOMP_Z_NULL || source->state == IPCOMP_Z_NULL) { + return IPCOMP_Z_STREAM_ERROR; } ss = source->state; *dest = *source; - ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); - if (ds == Z_NULL) return Z_MEM_ERROR; - dest->state = (struct internal_state FAR *) ds; + ds = (deflate_state *) IPCOMP_ZALLOC(dest, 1, sizeof(deflate_state)); + if (ds == IPCOMP_Z_NULL) return IPCOMP_Z_MEM_ERROR; + dest->state = (struct ipcomp_internal_state FAR *) ds; *ds = *ss; ds->strm = dest; - ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); - ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); - ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); + ds->window = (Bytef *) IPCOMP_ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); + ds->prev = (Posf *) IPCOMP_ZALLOC(dest, ds->w_size, sizeof(Pos)); + ds->head = (Posf *) IPCOMP_ZALLOC(dest, ds->hash_size, sizeof(Pos)); + overlay = (ushf *) IPCOMP_ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); ds->pending_buf = (uchf *) overlay; - if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || - ds->pending_buf == Z_NULL) { + if (ds->window == IPCOMP_Z_NULL || ds->prev == IPCOMP_Z_NULL || ds->head == IPCOMP_Z_NULL || + ds->pending_buf == IPCOMP_Z_NULL) { deflateEnd (dest); - return Z_MEM_ERROR; + return IPCOMP_Z_MEM_ERROR; } /* following zmemcpy do not work for 16-bit MSDOS */ zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); @@ -649,7 +649,7 @@ ds->d_desc.dyn_tree = ds->dyn_dtree; ds->bl_desc.dyn_tree = ds->bl_tree; - return Z_OK; + return IPCOMP_Z_OK; #endif } @@ -661,7 +661,7 @@ * (See also flush_pending()). */ local int read_buf(strm, buf, size) - z_streamp strm; + ipcomp_z_streamp strm; Bytef *buf; unsigned size; { @@ -1056,7 +1056,7 @@ #define FLUSH_BLOCK_ONLY(s, eof) { \ _tr_flush_block(s, (s->block_start >= 0L ? \ (charf *)&s->window[(unsigned)s->block_start] : \ - (charf *)Z_NULL), \ + (charf *)IPCOMP_Z_NULL), \ (ulg)((long)s->strstart - s->block_start), \ (eof)); \ s->block_start = s->strstart; \ @@ -1102,7 +1102,7 @@ s->block_start >= (long)s->w_size, "slide too late"); fill_window(s); - if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; + if (s->lookahead == 0 && flush == IPCOMP_Z_NO_FLUSH) return need_more; if (s->lookahead == 0) break; /* flush the current block */ } @@ -1126,8 +1126,8 @@ FLUSH_BLOCK(s, 0); } } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; + FLUSH_BLOCK(s, flush == IPCOMP_Z_FINISH); + return flush == IPCOMP_Z_FINISH ? finish_done : block_done; } /* =========================================================================== @@ -1152,7 +1152,7 @@ */ if (s->lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + if (s->lookahead < MIN_LOOKAHEAD && flush == IPCOMP_Z_NO_FLUSH) { return need_more; } if (s->lookahead == 0) break; /* flush the current block */ @@ -1173,7 +1173,7 @@ * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ - if (s->strategy != Z_HUFFMAN_ONLY) { + if (s->strategy != IPCOMP_Z_HUFFMAN_ONLY) { s->match_length = longest_match (s, hash_head); } /* longest_match() sets match_start */ @@ -1224,8 +1224,8 @@ } if (bflush) FLUSH_BLOCK(s, 0); } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; + FLUSH_BLOCK(s, flush == IPCOMP_Z_FINISH); + return flush == IPCOMP_Z_FINISH ? finish_done : block_done; } /* =========================================================================== @@ -1249,7 +1249,7 @@ */ if (s->lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + if (s->lookahead < MIN_LOOKAHEAD && flush == IPCOMP_Z_NO_FLUSH) { return need_more; } if (s->lookahead == 0) break; /* flush the current block */ @@ -1273,12 +1273,12 @@ * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ - if (s->strategy != Z_HUFFMAN_ONLY) { + if (s->strategy != IPCOMP_Z_HUFFMAN_ONLY) { s->match_length = longest_match (s, hash_head); } /* longest_match() sets match_start */ - if (s->match_length <= 5 && (s->strategy == Z_FILTERED || + if (s->match_length <= 5 && (s->strategy == IPCOMP_Z_FILTERED || (s->match_length == MIN_MATCH && s->strstart - s->match_start > TOO_FAR))) { @@ -1340,12 +1340,12 @@ s->lookahead--; } } - Assert (flush != Z_NO_FLUSH, "no flush?"); + Assert (flush != IPCOMP_Z_NO_FLUSH, "no flush?"); if (s->match_available) { Tracevv((stderr,"%c", s->window[s->strstart-1])); _tr_tally_lit(s, s->window[s->strstart-1], bflush); s->match_available = 0; } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; + FLUSH_BLOCK(s, flush == IPCOMP_Z_FINISH); + return flush == IPCOMP_Z_FINISH ? finish_done : block_done; } diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/deflate.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/deflate.h --- linux-2.4.34-wt1/net/ipsec/zlib/deflate.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/deflate.h 2007-02-18 12:23:52 +0100 @@ -10,8 +10,8 @@ /* @(#) $Id: deflate.h,v 1.1.1.1 2002/09/05 03:13:22 ken Exp $ */ -#ifndef _DEFLATE_H -#define _DEFLATE_H +#ifndef _IPCOMP_DEFLATE_H +#define _IPCOMP_DEFLATE_H #include "zutil.h" @@ -79,8 +79,8 @@ * save space in the various tables. IPos is used only for parameter passing. */ -typedef struct internal_state { - z_streamp strm; /* pointer back to this zlib stream */ +typedef struct ipcomp_internal_state { + ipcomp_z_streamp strm; /* pointer back to this zlib stream */ int status; /* as the name implies */ Bytef *pending_buf; /* output still pending */ ulg pending_buf_size; /* size of pending_buf */ @@ -315,4 +315,4 @@ flush = _tr_tally(s, distance, length) #endif -#endif /* _DEFLATE_H */ +#endif /* _IPCOMP_DEFLATE_H */ diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/infblock.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/infblock.c --- linux-2.4.34-wt1/net/ipsec/zlib/infblock.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/infblock.c 2007-02-18 12:23:52 +0100 @@ -67,59 +67,59 @@ void inflate_blocks_reset(s, z, c) inflate_blocks_statef *s; -z_streamp z; +ipcomp_z_streamp z; uLongf *c; { - if (c != Z_NULL) + if (c != IPCOMP_Z_NULL) *c = s->check; if (s->mode == BTREE || s->mode == DTREE) - ZFREE(z, s->sub.trees.blens); + IPCOMP_ZFREE(z, s->sub.trees.blens); if (s->mode == CODES) inflate_codes_free(s->sub.decode.codes, z); s->mode = TYPE; s->bitk = 0; s->bitb = 0; s->read = s->write = s->window; - if (s->checkfn != Z_NULL) - z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0); + if (s->checkfn != IPCOMP_Z_NULL) + z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)IPCOMP_Z_NULL, 0); Tracev((stderr, "inflate: blocks reset\n")); } inflate_blocks_statef *inflate_blocks_new(z, c, w) -z_streamp z; +ipcomp_z_streamp z; check_func c; uInt w; { inflate_blocks_statef *s; - if ((s = (inflate_blocks_statef *)ZALLOC - (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) + if ((s = (inflate_blocks_statef *)IPCOMP_ZALLOC + (z,1,sizeof(struct inflate_blocks_state))) == IPCOMP_Z_NULL) return s; if ((s->hufts = - (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL) + (inflate_huft *)IPCOMP_ZALLOC(z, sizeof(inflate_huft), MANY)) == IPCOMP_Z_NULL) { - ZFREE(z, s); - return Z_NULL; + IPCOMP_ZFREE(z, s); + return IPCOMP_Z_NULL; } - if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL) + if ((s->window = (Bytef *)IPCOMP_ZALLOC(z, 1, w)) == IPCOMP_Z_NULL) { - ZFREE(z, s->hufts); - ZFREE(z, s); - return Z_NULL; + IPCOMP_ZFREE(z, s->hufts); + IPCOMP_ZFREE(z, s); + return IPCOMP_Z_NULL; } s->end = s->window + w; s->checkfn = c; s->mode = TYPE; Tracev((stderr, "inflate: blocks allocated\n")); - inflate_blocks_reset(s, z, Z_NULL); + inflate_blocks_reset(s, z, IPCOMP_Z_NULL); return s; } int inflate_blocks(s, z, r) inflate_blocks_statef *s; -z_streamp z; +ipcomp_z_streamp z; int r; { uInt t; /* temporary storage */ @@ -159,9 +159,9 @@ inflate_trees_fixed(&bl, &bd, &tl, &td, z); s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); - if (s->sub.decode.codes == Z_NULL) + if (s->sub.decode.codes == IPCOMP_Z_NULL) { - r = Z_MEM_ERROR; + r = IPCOMP_Z_MEM_ERROR; LEAVE } } @@ -178,7 +178,7 @@ DUMPBITS(3) s->mode = BAD; z->msg = (char*)"invalid block type"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; LEAVE } break; @@ -188,7 +188,7 @@ { s->mode = BAD; z->msg = (char*)"invalid stored block lengths"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; LEAVE } s->sub.left = (uInt)b & 0xffff; @@ -221,14 +221,14 @@ { s->mode = BAD; z->msg = (char*)"too many length or distance symbols"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; LEAVE } #endif t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); - if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) + if ((s->sub.trees.blens = (uIntf*)IPCOMP_ZALLOC(z, t, sizeof(uInt))) == IPCOMP_Z_NULL) { - r = Z_MEM_ERROR; + r = IPCOMP_Z_MEM_ERROR; LEAVE } DUMPBITS(14) @@ -247,12 +247,12 @@ s->sub.trees.bb = 7; t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, &s->sub.trees.tb, s->hufts, z); - if (t != Z_OK) + if (t != IPCOMP_Z_OK) { r = t; - if (r == Z_DATA_ERROR) + if (r == IPCOMP_Z_DATA_ERROR) { - ZFREE(z, s->sub.trees.blens); + IPCOMP_ZFREE(z, s->sub.trees.blens); s->mode = BAD; } LEAVE @@ -290,10 +290,10 @@ if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) { - ZFREE(z, s->sub.trees.blens); + IPCOMP_ZFREE(z, s->sub.trees.blens); s->mode = BAD; z->msg = (char*)"invalid bit length repeat"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; LEAVE } c = c == 16 ? s->sub.trees.blens[i - 1] : 0; @@ -303,7 +303,7 @@ s->sub.trees.index = i; } } - s->sub.trees.tb = Z_NULL; + s->sub.trees.tb = IPCOMP_Z_NULL; { uInt bl, bd; inflate_huft *tl, *td; @@ -315,31 +315,31 @@ t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), s->sub.trees.blens, &bl, &bd, &tl, &td, s->hufts, z); - if (t != Z_OK) + if (t != IPCOMP_Z_OK) { - if (t == (uInt)Z_DATA_ERROR) + if (t == (uInt)IPCOMP_Z_DATA_ERROR) { - ZFREE(z, s->sub.trees.blens); + IPCOMP_ZFREE(z, s->sub.trees.blens); s->mode = BAD; } r = t; LEAVE } Tracev((stderr, "inflate: trees ok\n")); - if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) + if ((c = inflate_codes_new(bl, bd, tl, td, z)) == IPCOMP_Z_NULL) { - r = Z_MEM_ERROR; + r = IPCOMP_Z_MEM_ERROR; LEAVE } s->sub.decode.codes = c; } - ZFREE(z, s->sub.trees.blens); + IPCOMP_ZFREE(z, s->sub.trees.blens); s->mode = CODES; case CODES: UPDATE - if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) + if ((r = inflate_codes(s, z, r)) != IPCOMP_Z_STREAM_END) return inflate_flush(s, z, r); - r = Z_OK; + r = IPCOMP_Z_OK; inflate_codes_free(s->sub.decode.codes, z); LOAD Tracev((stderr, "inflate: codes end, %lu total out\n", @@ -357,13 +357,13 @@ LEAVE s->mode = DONE; case DONE: - r = Z_STREAM_END; + r = IPCOMP_Z_STREAM_END; LEAVE case BAD: - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; LEAVE default: - r = Z_STREAM_ERROR; + r = IPCOMP_Z_STREAM_ERROR; LEAVE } } @@ -371,14 +371,14 @@ int inflate_blocks_free(s, z) inflate_blocks_statef *s; -z_streamp z; +ipcomp_z_streamp z; { - inflate_blocks_reset(s, z, Z_NULL); - ZFREE(z, s->window); - ZFREE(z, s->hufts); - ZFREE(z, s); + inflate_blocks_reset(s, z, IPCOMP_Z_NULL); + IPCOMP_ZFREE(z, s->window); + IPCOMP_ZFREE(z, s->hufts); + IPCOMP_ZFREE(z, s); Tracev((stderr, "inflate: blocks freed\n")); - return Z_OK; + return IPCOMP_Z_OK; } @@ -393,8 +393,8 @@ /* Returns true if inflate is currently at the end of a block generated - * by Z_SYNC_FLUSH or Z_FULL_FLUSH. - * IN assertion: s != Z_NULL + * by IPCOMP_Z_SYNC_FLUSH or IPCOMP_Z_FULL_FLUSH. + * IN assertion: s != IPCOMP_Z_NULL */ int inflate_blocks_sync_point(s) inflate_blocks_statef *s; diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/infblock.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/infblock.h --- linux-2.4.34-wt1/net/ipsec/zlib/infblock.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/infblock.h 2007-02-18 12:23:52 +0100 @@ -12,23 +12,23 @@ typedef struct inflate_blocks_state FAR inflate_blocks_statef; extern inflate_blocks_statef * inflate_blocks_new OF(( - z_streamp z, + ipcomp_z_streamp z, check_func c, /* check function */ uInt w)); /* window size */ extern int inflate_blocks OF(( inflate_blocks_statef *, - z_streamp , + ipcomp_z_streamp , int)); /* initial return code */ extern void inflate_blocks_reset OF(( inflate_blocks_statef *, - z_streamp , + ipcomp_z_streamp , uLongf *)); /* check value on output */ extern int inflate_blocks_free OF(( inflate_blocks_statef *, - z_streamp)); + ipcomp_z_streamp)); extern void inflate_set_dictionary OF(( inflate_blocks_statef *s, diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/infcodes.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/infcodes.c --- linux-2.4.34-wt1/net/ipsec/zlib/infcodes.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/infcodes.c 2007-02-18 12:23:52 +0100 @@ -60,12 +60,12 @@ uInt bl, bd; inflate_huft *tl; inflate_huft *td; /* need separate declaration for Borland C++ */ -z_streamp z; +ipcomp_z_streamp z; { inflate_codes_statef *c; if ((c = (inflate_codes_statef *) - ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL) + IPCOMP_ZALLOC(z,1,sizeof(struct inflate_codes_state))) != IPCOMP_Z_NULL) { c->mode = START; c->lbits = (Byte)bl; @@ -80,7 +80,7 @@ int inflate_codes(s, z, r) inflate_blocks_statef *s; -z_streamp z; +ipcomp_z_streamp z; int r; { uInt j; /* temporary storage */ @@ -108,9 +108,9 @@ UPDATE r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); LOAD - if (r != Z_OK) + if (r != IPCOMP_Z_OK) { - c->mode = r == Z_STREAM_END ? WASH : BADCODE; + c->mode = r == IPCOMP_Z_STREAM_END ? WASH : BADCODE; break; } } @@ -154,7 +154,7 @@ } c->mode = BADCODE; /* invalid code */ z->msg = (char*)"invalid literal/length code"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; LEAVE case LENEXT: /* i: getting length extra (have base) */ j = c->sub.copy.get; @@ -186,7 +186,7 @@ } c->mode = BADCODE; /* invalid code */ z->msg = (char*)"invalid distance code"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; LEAVE case DISTEXT: /* i: getting distance extra */ j = c->sub.copy.get; @@ -227,25 +227,25 @@ LEAVE c->mode = END; case END: - r = Z_STREAM_END; + r = IPCOMP_Z_STREAM_END; LEAVE case BADCODE: /* x: got error */ - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; LEAVE default: - r = Z_STREAM_ERROR; + r = IPCOMP_Z_STREAM_ERROR; LEAVE } #ifdef NEED_DUMMY_RETURN - return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ + return IPCOMP_Z_STREAM_ERROR; /* Some dumb compilers complain without this */ #endif } void inflate_codes_free(c, z) inflate_codes_statef *c; -z_streamp z; +ipcomp_z_streamp z; { - ZFREE(z, c); + IPCOMP_ZFREE(z, c); Tracev((stderr, "inflate: codes free\n")); } diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/infcodes.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/infcodes.h --- linux-2.4.34-wt1/net/ipsec/zlib/infcodes.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/infcodes.h 2007-02-18 12:23:52 +0100 @@ -8,8 +8,8 @@ subject to change. Applications should only use zlib.h. */ -#ifndef _INFCODES_H -#define _INFCODES_H +#ifndef _IPCOMP_INFCODES_H +#define _IPCOMP_INFCODES_H struct inflate_codes_state; typedef struct inflate_codes_state FAR inflate_codes_statef; @@ -17,15 +17,15 @@ extern inflate_codes_statef *inflate_codes_new OF(( uInt, uInt, inflate_huft *, inflate_huft *, - z_streamp )); + ipcomp_z_streamp )); extern int inflate_codes OF(( inflate_blocks_statef *, - z_streamp , + ipcomp_z_streamp , int)); extern void inflate_codes_free OF(( inflate_codes_statef *, - z_streamp )); + ipcomp_z_streamp )); -#endif /* _INFCODES_H */ +#endif /* _IPCOMP_INFCODES_H */ diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/inffast.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/inffast.c --- linux-2.4.34-wt1/net/ipsec/zlib/inffast.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/inffast.c 2007-02-18 12:23:52 +0100 @@ -30,7 +30,7 @@ inflate_huft *tl; inflate_huft *td; /* need separate declaration for Borland C++ */ inflate_blocks_statef *s; -z_streamp z; +ipcomp_z_streamp z; { inflate_huft *t; /* temporary pointer */ uInt e; /* extra bits or operation */ @@ -140,7 +140,7 @@ z->msg = (char*)"invalid distance code"; UNGRAB UPDATE - return Z_DATA_ERROR; + return IPCOMP_Z_DATA_ERROR; } } while (1); break; @@ -164,14 +164,14 @@ Tracevv((stderr, "inflate: * end of block\n")); UNGRAB UPDATE - return Z_STREAM_END; + return IPCOMP_Z_STREAM_END; } else { z->msg = (char*)"invalid literal/length code"; UNGRAB UPDATE - return Z_DATA_ERROR; + return IPCOMP_Z_DATA_ERROR; } } while (1); } while (m >= 258 && n >= 10); @@ -179,5 +179,5 @@ /* not enough input or output--restore pointers and return */ UNGRAB UPDATE - return Z_OK; + return IPCOMP_Z_OK; } diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/inffast.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/inffast.h --- linux-2.4.34-wt1/net/ipsec/zlib/inffast.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/inffast.h 2007-02-18 12:23:52 +0100 @@ -8,8 +8,8 @@ subject to change. Applications should only use zlib.h. */ -#ifndef _INFFAST_H -#define _INFFAST_H +#ifndef _IPCOMP_INFFAST_H +#define _IPCOMP_INFFAST_H extern int inflate_fast OF(( uInt, @@ -17,6 +17,6 @@ inflate_huft *, inflate_huft *, inflate_blocks_statef *, - z_streamp )); + ipcomp_z_streamp )); -#endif /* _INFFAST_H */ +#endif /* _IPCOMP_INFFAST_H */ diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/inflate.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/inflate.c --- linux-2.4.34-wt1/net/ipsec/zlib/inflate.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/inflate.c 2007-02-18 12:23:52 +0100 @@ -26,7 +26,7 @@ inflate_mode; /* inflate private state */ -struct internal_state { +struct ipcomp_internal_state { /* mode */ inflate_mode mode; /* current inflate mode */ @@ -50,60 +50,60 @@ }; -int ZEXPORT inflateReset(z) -z_streamp z; +int IPCOMP_ZEXPORT inflateReset(z) +ipcomp_z_streamp z; { - if (z == Z_NULL || z->state == Z_NULL) - return Z_STREAM_ERROR; + if (z == IPCOMP_Z_NULL || z->state == IPCOMP_Z_NULL) + return IPCOMP_Z_STREAM_ERROR; z->total_in = z->total_out = 0; - z->msg = Z_NULL; + z->msg = IPCOMP_Z_NULL; z->state->mode = z->state->nowrap ? BLOCKS : METHOD; - inflate_blocks_reset(z->state->blocks, z, Z_NULL); + inflate_blocks_reset(z->state->blocks, z, IPCOMP_Z_NULL); Tracev((stderr, "inflate: reset\n")); - return Z_OK; + return IPCOMP_Z_OK; } -int ZEXPORT inflateEnd(z) -z_streamp z; +int IPCOMP_ZEXPORT inflateEnd(z) +ipcomp_z_streamp z; { - if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL) - return Z_STREAM_ERROR; - if (z->state->blocks != Z_NULL) + if (z == IPCOMP_Z_NULL || z->state == IPCOMP_Z_NULL || z->zfree == IPCOMP_Z_NULL) + return IPCOMP_Z_STREAM_ERROR; + if (z->state->blocks != IPCOMP_Z_NULL) inflate_blocks_free(z->state->blocks, z); - ZFREE(z, z->state); - z->state = Z_NULL; + IPCOMP_ZFREE(z, z->state); + z->state = IPCOMP_Z_NULL; Tracev((stderr, "inflate: end\n")); - return Z_OK; + return IPCOMP_Z_OK; } -int ZEXPORT inflateInit2_(z, w, version, stream_size) -z_streamp z; +int IPCOMP_ZEXPORT inflateInit2_(z, w, version, stream_size) +ipcomp_z_streamp z; int w; const char *version; int stream_size; { - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != sizeof(z_stream)) - return Z_VERSION_ERROR; + if (version == IPCOMP_Z_NULL || version[0] != IPCOMP_ZLIB_VERSION[0] || + stream_size != sizeof(ipcomp_z_stream)) + return IPCOMP_Z_VERSION_ERROR; /* initialize state */ - if (z == Z_NULL) - return Z_STREAM_ERROR; - z->msg = Z_NULL; - if (z->zalloc == Z_NULL) + if (z == IPCOMP_Z_NULL) + return IPCOMP_Z_STREAM_ERROR; + z->msg = IPCOMP_Z_NULL; + if (z->zalloc == IPCOMP_Z_NULL) { - return Z_STREAM_ERROR; + return IPCOMP_Z_STREAM_ERROR; /* z->zalloc = zcalloc; z->opaque = (voidpf)0; */ } - if (z->zfree == Z_NULL) return Z_STREAM_ERROR; /* z->zfree = zcfree; */ - if ((z->state = (struct internal_state FAR *) - ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL) - return Z_MEM_ERROR; - z->state->blocks = Z_NULL; + if (z->zfree == IPCOMP_Z_NULL) return IPCOMP_Z_STREAM_ERROR; /* z->zfree = zcfree; */ + if ((z->state = (struct ipcomp_internal_state FAR *) + IPCOMP_ZALLOC(z,1,sizeof(struct ipcomp_internal_state))) == IPCOMP_Z_NULL) + return IPCOMP_Z_MEM_ERROR; + z->state->blocks = IPCOMP_Z_NULL; /* handle undocumented nowrap option (no zlib header or check) */ z->state->nowrap = 0; @@ -117,28 +117,28 @@ if (w < 8 || w > 15) { inflateEnd(z); - return Z_STREAM_ERROR; + return IPCOMP_Z_STREAM_ERROR; } z->state->wbits = (uInt)w; /* create inflate_blocks state */ if ((z->state->blocks = - inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w)) - == Z_NULL) + inflate_blocks_new(z, z->state->nowrap ? IPCOMP_Z_NULL : adler32, (uInt)1 << w)) + == IPCOMP_Z_NULL) { inflateEnd(z); - return Z_MEM_ERROR; + return IPCOMP_Z_MEM_ERROR; } Tracev((stderr, "inflate: allocated\n")); /* reset state */ inflateReset(z); - return Z_OK; + return IPCOMP_Z_OK; } -int ZEXPORT inflateInit_(z, version, stream_size) -z_streamp z; +int IPCOMP_ZEXPORT inflateInit_(z, version, stream_size) +ipcomp_z_streamp z; const char *version; int stream_size; { @@ -149,22 +149,22 @@ #define NEEDBYTE {if(z->avail_in==0)return r;r=f;} #define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) -int ZEXPORT inflate(z, f) -z_streamp z; +int IPCOMP_ZEXPORT inflate(z, f) +ipcomp_z_streamp z; int f; { int r; uInt b; - if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL) - return Z_STREAM_ERROR; - f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; - r = Z_BUF_ERROR; + if (z == IPCOMP_Z_NULL || z->state == IPCOMP_Z_NULL || z->next_in == IPCOMP_Z_NULL) + return IPCOMP_Z_STREAM_ERROR; + f = f == IPCOMP_Z_FINISH ? IPCOMP_Z_BUF_ERROR : IPCOMP_Z_OK; + r = IPCOMP_Z_BUF_ERROR; while (1) switch (z->state->mode) { case METHOD: NEEDBYTE - if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED) + if (((z->state->sub.method = NEXTBYTE) & 0xf) != IPCOMP_Z_DEFLATED) { z->state->mode = BAD; z->msg = (char*)"unknown compression method"; @@ -213,23 +213,23 @@ z->state->sub.check.need += (uLong)NEXTBYTE; z->adler = z->state->sub.check.need; z->state->mode = DICT0; - return Z_NEED_DICT; + return IPCOMP_Z_NEED_DICT; case DICT0: z->state->mode = BAD; z->msg = (char*)"need dictionary"; z->state->sub.marker = 0; /* can try inflateSync */ - return Z_STREAM_ERROR; + return IPCOMP_Z_STREAM_ERROR; case BLOCKS: r = inflate_blocks(z->state->blocks, z, r); - if (r == Z_DATA_ERROR) + if (r == IPCOMP_Z_DATA_ERROR) { z->state->mode = BAD; z->state->sub.marker = 0; /* can try inflateSync */ break; } - if (r == Z_OK) + if (r == IPCOMP_Z_OK) r = f; - if (r != Z_STREAM_END) + if (r != IPCOMP_Z_STREAM_END) return r; r = f; inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); @@ -265,29 +265,29 @@ Tracev((stderr, "inflate: zlib check ok\n")); z->state->mode = DONE; case DONE: - return Z_STREAM_END; + return IPCOMP_Z_STREAM_END; case BAD: - return Z_DATA_ERROR; + return IPCOMP_Z_DATA_ERROR; default: - return Z_STREAM_ERROR; + return IPCOMP_Z_STREAM_ERROR; } #ifdef NEED_DUMMY_RETURN - return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ + return IPCOMP_Z_STREAM_ERROR; /* Some dumb compilers complain without this */ #endif } -int ZEXPORT inflateSetDictionary(z, dictionary, dictLength) -z_streamp z; +int IPCOMP_ZEXPORT inflateSetDictionary(z, dictionary, dictLength) +ipcomp_z_streamp z; const Bytef *dictionary; uInt dictLength; { uInt length = dictLength; - if (z == Z_NULL || z->state == Z_NULL || z->state->mode != DICT0) - return Z_STREAM_ERROR; + if (z == IPCOMP_Z_NULL || z->state == IPCOMP_Z_NULL || z->state->mode != DICT0) + return IPCOMP_Z_STREAM_ERROR; - if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR; + if (adler32(1L, dictionary, dictLength) != z->adler) return IPCOMP_Z_DATA_ERROR; z->adler = 1L; if (length >= ((uInt)1<state->wbits)) @@ -297,12 +297,12 @@ } inflate_set_dictionary(z->state->blocks, dictionary, length); z->state->mode = BLOCKS; - return Z_OK; + return IPCOMP_Z_OK; } -int ZEXPORT inflateSync(z) -z_streamp z; +int IPCOMP_ZEXPORT inflateSync(z) +ipcomp_z_streamp z; { uInt n; /* number of bytes to look at */ Bytef *p; /* pointer to bytes */ @@ -310,15 +310,15 @@ uLong r, w; /* temporaries to save total_in and total_out */ /* set up */ - if (z == Z_NULL || z->state == Z_NULL) - return Z_STREAM_ERROR; + if (z == IPCOMP_Z_NULL || z->state == IPCOMP_Z_NULL) + return IPCOMP_Z_STREAM_ERROR; if (z->state->mode != BAD) { z->state->mode = BAD; z->state->sub.marker = 0; } if ((n = z->avail_in) == 0) - return Z_BUF_ERROR; + return IPCOMP_Z_BUF_ERROR; p = z->next_in; m = z->state->sub.marker; @@ -343,26 +343,26 @@ /* return no joy or set up to restart on a new block */ if (m != 4) - return Z_DATA_ERROR; + return IPCOMP_Z_DATA_ERROR; r = z->total_in; w = z->total_out; inflateReset(z); z->total_in = r; z->total_out = w; z->state->mode = BLOCKS; - return Z_OK; + return IPCOMP_Z_OK; } /* Returns true if inflate is currently at the end of a block generated - * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP - * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH + * by IPCOMP_Z_SYNC_FLUSH or IPCOMP_Z_FULL_FLUSH. This function is used by one PPP + * implementation to provide an additional safety check. PPP uses IPCOMP_Z_SYNC_FLUSH * but removes the length bytes of the resulting empty stored block. When * decompressing, PPP checks that at the end of input packet, inflate is * waiting for these length bytes. */ -int ZEXPORT inflateSyncPoint(z) -z_streamp z; +int IPCOMP_ZEXPORT inflateSyncPoint(z) +ipcomp_z_streamp z; { - if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL) - return Z_STREAM_ERROR; + if (z == IPCOMP_Z_NULL || z->state == IPCOMP_Z_NULL || z->state->blocks == IPCOMP_Z_NULL) + return IPCOMP_Z_STREAM_ERROR; return inflate_blocks_sync_point(z->state->blocks); } diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/inftrees.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/inftrees.c --- linux-2.4.34-wt1/net/ipsec/zlib/inftrees.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/inftrees.c 2007-02-18 12:23:52 +0100 @@ -18,7 +18,7 @@ include such an acknowledgment, I would appreciate that you keep this copyright string in the executable of your product. */ -struct internal_state {int dummy;}; /* for buggy compilers */ +struct ipcomp_internal_state {int dummy;}; /* for buggy compilers */ /* simplify the use of the inflate_huft type with some defines */ #define exop word.what.Exop @@ -102,9 +102,9 @@ uInt *hn; /* hufts used in space */ uIntf *v; /* working area: values in order of bit length */ /* Given a list of code lengths and a maximum table size, make a set of - tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + tables to decode that set of codes. Return IPCOMP_Z_OK on success, IPCOMP_Z_BUF_ERROR if the given code set is incomplete (the tables are still built in this - case), or Z_DATA_ERROR if the input is invalid. */ + case), or IPCOMP_Z_DATA_ERROR if the input is invalid. */ { uInt a; /* counter for codes of length k */ @@ -140,9 +140,9 @@ } while (--i); if (c[0] == n) /* null input--all zero length codes */ { - *t = (inflate_huft *)Z_NULL; + *t = (inflate_huft *)IPCOMP_Z_NULL; *m = 0; - return Z_OK; + return IPCOMP_Z_OK; } @@ -166,9 +166,9 @@ /* Adjust last length count to fill out codes, if needed */ for (y = 1 << j; j < i; j++, y <<= 1) if ((y -= c[j]) < 0) - return Z_DATA_ERROR; + return IPCOMP_Z_DATA_ERROR; if ((y -= c[i]) < 0) - return Z_DATA_ERROR; + return IPCOMP_Z_DATA_ERROR; c[i] += y; @@ -194,8 +194,8 @@ p = v; /* grab values in bit order */ h = -1; /* no tables yet--level -1 */ w = -l; /* bits decoded == (l * h) */ - u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */ - q = (inflate_huft *)Z_NULL; /* ditto */ + u[0] = (inflate_huft *)IPCOMP_Z_NULL; /* just to keep compilers happy */ + q = (inflate_huft *)IPCOMP_Z_NULL; /* ditto */ z = 0; /* ditto */ /* go through the bit lengths (k already is bits in shortest code) */ @@ -230,7 +230,7 @@ /* allocate new table */ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ - return Z_DATA_ERROR; /* overflow of MANY */ + return IPCOMP_Z_DATA_ERROR; /* overflow of MANY */ u[h] = q = hp + *hn; *hn += z; @@ -285,8 +285,8 @@ } - /* Return Z_BUF_ERROR if we were given an incomplete table */ - return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; + /* Return IPCOMP_Z_BUF_ERROR if we were given an incomplete table */ + return y != 0 && g != 1 ? IPCOMP_Z_BUF_ERROR : IPCOMP_Z_OK; } @@ -295,24 +295,24 @@ uIntf *bb; /* bits tree desired/actual depth */ inflate_huft * FAR *tb; /* bits tree result */ inflate_huft *hp; /* space for trees */ -z_streamp z; /* for messages */ +ipcomp_z_streamp z; /* for messages */ { int r; uInt hn = 0; /* hufts used in space */ uIntf *v; /* work area for huft_build */ - if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL) - return Z_MEM_ERROR; - r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, + if ((v = (uIntf*)IPCOMP_ZALLOC(z, 19, sizeof(uInt))) == IPCOMP_Z_NULL) + return IPCOMP_Z_MEM_ERROR; + r = huft_build(c, 19, 19, (uIntf*)IPCOMP_Z_NULL, (uIntf*)IPCOMP_Z_NULL, tb, bb, hp, &hn, v); - if (r == Z_DATA_ERROR) + if (r == IPCOMP_Z_DATA_ERROR) z->msg = (char*)"oversubscribed dynamic bit lengths tree"; - else if (r == Z_BUF_ERROR || *bb == 0) + else if (r == IPCOMP_Z_BUF_ERROR || *bb == 0) { z->msg = (char*)"incomplete dynamic bit lengths tree"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; } - ZFREE(z, v); + IPCOMP_ZFREE(z, v); return r; } @@ -326,58 +326,58 @@ inflate_huft * FAR *tl; /* literal/length tree result */ inflate_huft * FAR *td; /* distance tree result */ inflate_huft *hp; /* space for trees */ -z_streamp z; /* for messages */ +ipcomp_z_streamp z; /* for messages */ { int r; uInt hn = 0; /* hufts used in space */ uIntf *v; /* work area for huft_build */ /* allocate work area */ - if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) - return Z_MEM_ERROR; + if ((v = (uIntf*)IPCOMP_ZALLOC(z, 288, sizeof(uInt))) == IPCOMP_Z_NULL) + return IPCOMP_Z_MEM_ERROR; /* build literal/length tree */ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); - if (r != Z_OK || *bl == 0) + if (r != IPCOMP_Z_OK || *bl == 0) { - if (r == Z_DATA_ERROR) + if (r == IPCOMP_Z_DATA_ERROR) z->msg = (char*)"oversubscribed literal/length tree"; - else if (r != Z_MEM_ERROR) + else if (r != IPCOMP_Z_MEM_ERROR) { z->msg = (char*)"incomplete literal/length tree"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; } - ZFREE(z, v); + IPCOMP_ZFREE(z, v); return r; } /* build distance tree */ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); - if (r != Z_OK || (*bd == 0 && nl > 257)) + if (r != IPCOMP_Z_OK || (*bd == 0 && nl > 257)) { - if (r == Z_DATA_ERROR) + if (r == IPCOMP_Z_DATA_ERROR) z->msg = (char*)"oversubscribed distance tree"; - else if (r == Z_BUF_ERROR) { + else if (r == IPCOMP_Z_BUF_ERROR) { #ifdef PKZIP_BUG_WORKAROUND - r = Z_OK; + r = IPCOMP_Z_OK; } #else z->msg = (char*)"incomplete distance tree"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; } - else if (r != Z_MEM_ERROR) + else if (r != IPCOMP_Z_MEM_ERROR) { z->msg = (char*)"empty distance tree with lengths"; - r = Z_DATA_ERROR; + r = IPCOMP_Z_DATA_ERROR; } - ZFREE(z, v); + IPCOMP_ZFREE(z, v); return r; #endif } /* done */ - ZFREE(z, v); - return Z_OK; + IPCOMP_ZFREE(z, v); + return IPCOMP_Z_OK; } @@ -400,7 +400,7 @@ uIntf *bd; /* distance desired/actual bit depth */ inflate_huft * FAR *tl; /* literal/length tree result */ inflate_huft * FAR *td; /* distance tree result */ -z_streamp z; /* for memory allocation */ +ipcomp_z_streamp z; /* for memory allocation */ { #ifdef BUILDFIXED /* build fixed tables if not already */ @@ -412,12 +412,12 @@ uIntf *v; /* work area for huft_build */ /* allocate memory */ - if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) - return Z_MEM_ERROR; - if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + if ((c = (uIntf*)IPCOMP_ZALLOC(z, 288, sizeof(uInt))) == IPCOMP_Z_NULL) + return IPCOMP_Z_MEM_ERROR; + if ((v = (uIntf*)IPCOMP_ZALLOC(z, 288, sizeof(uInt))) == IPCOMP_Z_NULL) { - ZFREE(z, c); - return Z_MEM_ERROR; + IPCOMP_ZFREE(z, c); + return IPCOMP_Z_MEM_ERROR; } /* literal table */ @@ -441,8 +441,8 @@ fixed_mem, &f, v); /* done */ - ZFREE(z, v); - ZFREE(z, c); + IPCOMP_ZFREE(z, v); + IPCOMP_ZFREE(z, c); fixed_built = 1; } #endif @@ -450,5 +450,5 @@ *bd = fixed_bd; *tl = fixed_tl; *td = fixed_td; - return Z_OK; + return IPCOMP_Z_OK; } diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/inftrees.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/inftrees.h --- linux-2.4.34-wt1/net/ipsec/zlib/inftrees.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/inftrees.h 2007-02-18 12:23:52 +0100 @@ -11,8 +11,8 @@ /* Huffman code lookup table entry--this entry is four bytes for machines that have 16-bit pointers (e.g. PC's in the small or medium model). */ -#ifndef _INFTREES_H -#define _INFTREES_H +#ifndef _IPCOMP_INFTREES_H +#define _IPCOMP_INFTREES_H typedef struct inflate_huft_s FAR inflate_huft; @@ -40,7 +40,7 @@ uIntf *, /* bits tree desired/actual depth */ inflate_huft * FAR *, /* bits tree result */ inflate_huft *, /* space for trees */ - z_streamp)); /* for messages */ + ipcomp_z_streamp)); /* for messages */ extern int inflate_trees_dynamic OF(( uInt, /* number of literal/length codes */ @@ -51,13 +51,13 @@ inflate_huft * FAR *, /* literal/length tree result */ inflate_huft * FAR *, /* distance tree result */ inflate_huft *, /* space for trees */ - z_streamp)); /* for messages */ + ipcomp_z_streamp)); /* for messages */ extern int inflate_trees_fixed OF(( uIntf *, /* literal desired/actual bit depth */ uIntf *, /* distance desired/actual bit depth */ inflate_huft * FAR *, /* literal/length tree result */ inflate_huft * FAR *, /* distance tree result */ - z_streamp)); /* for memory allocation */ + ipcomp_z_streamp)); /* for memory allocation */ -#endif /* _INFTREES_H */ +#endif /* _IPCOMP_INFTREES_H */ diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/infutil.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/infutil.c --- linux-2.4.34-wt1/net/ipsec/zlib/infutil.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/infutil.c 2007-02-18 12:23:52 +0100 @@ -22,7 +22,7 @@ /* copy as much as possible from the sliding window to the output area */ int inflate_flush(s, z, r) inflate_blocks_statef *s; -z_streamp z; +ipcomp_z_streamp z; int r; { uInt n; @@ -36,14 +36,14 @@ /* compute number of bytes to copy as far as end of window */ n = (uInt)((q <= s->write ? s->write : s->end) - q); if (n > z->avail_out) n = z->avail_out; - if (n && r == Z_BUF_ERROR) r = Z_OK; + if (n && r == IPCOMP_Z_BUF_ERROR) r = IPCOMP_Z_OK; /* update counters */ z->avail_out -= n; z->total_out += n; /* update check information */ - if (s->checkfn != Z_NULL) + if (s->checkfn != IPCOMP_Z_NULL) z->adler = s->check = (*s->checkfn)(s->check, q, n); /* copy as far as end of window */ @@ -62,14 +62,14 @@ /* compute bytes to copy */ n = (uInt)(s->write - q); if (n > z->avail_out) n = z->avail_out; - if (n && r == Z_BUF_ERROR) r = Z_OK; + if (n && r == IPCOMP_Z_BUF_ERROR) r = IPCOMP_Z_OK; /* update counters */ z->avail_out -= n; z->total_out += n; /* update check information */ - if (s->checkfn != Z_NULL) + if (s->checkfn != IPCOMP_Z_NULL) z->adler = s->check = (*s->checkfn)(s->check, q, n); /* copy */ diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/infutil.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/infutil.h --- linux-2.4.34-wt1/net/ipsec/zlib/infutil.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/infutil.h 2007-02-18 12:23:52 +0100 @@ -8,8 +8,8 @@ subject to change. Applications should only use zlib.h. */ -#ifndef _INFUTIL_H -#define _INFUTIL_H +#ifndef _IPCOMP_INFUTIL_H +#define _IPCOMP_INFUTIL_H typedef enum { TYPE, /* get type bits (3, including end bit) */ @@ -70,7 +70,7 @@ #define LEAVE {UPDATE return inflate_flush(s,z,r);} /* get bytes and bits */ #define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} -#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} +#define NEEDBYTE {if(n)r=IPCOMP_Z_OK;else LEAVE} #define NEXTBYTE (n--,*p++) #define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} @@ -79,7 +79,7 @@ #define LOADOUT {q=s->write;m=(uInt)WAVAIL;} #define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} #define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} -#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} +#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=IPCOMP_Z_OK;} #define OUTBYTE(a) {*q++=(Byte)(a);m--;} /* load local pointers */ #define LOAD {LOADIN LOADOUT} @@ -90,9 +90,9 @@ /* copy as much as possible from the sliding window to the output area */ extern int inflate_flush OF(( inflate_blocks_statef *, - z_streamp , + ipcomp_z_streamp , int)); -struct internal_state {int dummy;}; /* for buggy compilers */ +struct ipcomp_internal_state {int dummy;}; /* for buggy compilers */ -#endif /* _INFUTIL_H */ +#endif /* _IPCOMP_INFUTIL_H */ diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/trees.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/trees.c --- linux-2.4.34-wt1/net/ipsec/zlib/trees.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/trees.c 2007-02-18 12:23:52 +0100 @@ -931,7 +931,7 @@ if (s->level > 0) { /* Check if the file is ascii or binary */ - if (s->data_type == Z_UNKNOWN) set_data_type(s); + if (s->data_type == IPCOMP_Z_UNKNOWN) set_data_type(s); /* Construct the literal and distance trees */ build_tree(s, (tree_desc *)(&(s->l_desc))); @@ -1130,7 +1130,7 @@ while (n < 7) bin_freq += s->dyn_ltree[n++].Freq; while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq; while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq; - s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); + s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? IPCOMP_Z_BINARY : IPCOMP_Z_ASCII); } /* =========================================================================== diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/zconf.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/zconf.h --- linux-2.4.34-wt1/net/ipsec/zlib/zconf.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/zconf.h 2007-02-18 12:30:02 +0100 @@ -5,8 +5,8 @@ /* @(#) $Id: zconf.h,v 1.1.1.1 2002/09/05 03:13:22 ken Exp $ */ -#ifndef _ZCONF_H -#define _ZCONF_H +#ifndef _IPCOMP_ZCONF_H +#define _IPCOMP_ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, @@ -65,17 +65,29 @@ # define longest_match ipcomp_longest_match #endif -#ifdef Z_PREFIX -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp +#if defined(Z_PREFIX) || defined (IPCOMP_PREFIX) +// might have been defined by the official zlib +# undef Byte +# undef uInt +# undef uLong +# undef Bytef +# undef charf +# undef intf +# undef uIntf +# undef uLongf +# undef voidpf +# undef voidp + +# define Byte ipcomp_Byte +# define uInt ipcomp_uInt +# define uLong ipcomp_uLong +# define Bytef ipcomp_Bytef +# define charf ipcomp_charf +# define intf ipcomp_intf +# define uIntf ipcomp_uIntf +# define uLongf ipcomp_uLongf +# define voidpf ipcomp_voidpf +# define voidp ipcomp_voidp #endif #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) @@ -197,22 +209,22 @@ # undef FAR # endif # include -# define ZEXPORT WINAPI +# define IPCOMP_ZEXPORT WINAPI # ifdef WIN32 -# define ZEXPORTVA WINAPIV +# define IPCOMP_ZEXPORTVA WINAPIV # else -# define ZEXPORTVA FAR _cdecl _export +# define IPCOMP_ZEXPORTVA FAR _cdecl _export # endif # endif # if defined (__BORLANDC__) # if (__BORLANDC__ >= 0x0500) && defined (WIN32) # include -# define ZEXPORT __declspec(dllexport) WINAPI -# define ZEXPORTRVA __declspec(dllexport) WINAPIV +# define IPCOMP_ZEXPORT __declspec(dllexport) WINAPI +# define IPCOMP_ZEXPORTRVA __declspec(dllexport) WINAPIV # else # if defined (_Windows) && defined (__DLL__) -# define ZEXPORT _export -# define ZEXPORTVA _export +# define IPCOMP_ZEXPORT _export +# define IPCOMP_ZEXPORTVA _export # endif # endif # endif @@ -220,20 +232,20 @@ #if defined (__BEOS__) # if defined (ZLIB_DLL) -# define ZEXTERN extern __declspec(dllexport) +# define IPCOMP_ZEXTERN extern __declspec(dllexport) # else -# define ZEXTERN extern __declspec(dllimport) +# define IPCOMP_ZEXTERN extern __declspec(dllimport) # endif #endif -#ifndef ZEXPORT -# define ZEXPORT +#ifndef IPCOMP_ZEXPORT +# define IPCOMP_ZEXPORT #endif -#ifndef ZEXPORTVA -# define ZEXPORTVA +#ifndef IPCOMP_ZEXPORTVA +# define IPCOMP_ZEXPORTVA #endif -#ifndef ZEXTERN -# define ZEXTERN extern +#ifndef IPCOMP_ZEXTERN +# define IPCOMP_ZEXTERN extern #endif #ifndef FAR @@ -306,4 +318,4 @@ # pragma map(inflate_trees_free,"INTRFR") #endif -#endif /* _ZCONF_H */ +#endif /* _IPCOMP_ZCONF_H */ diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/zlib.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/zlib.h --- linux-2.4.34-wt1/net/ipsec/zlib/zlib.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/zlib.h 2007-02-18 12:23:52 +0100 @@ -28,8 +28,8 @@ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). */ -#ifndef _ZLIB_H -#define _ZLIB_H +#ifndef _IPCOMP_ZLIB_H +#define _IPCOMP_ZLIB_H #include "zconf.h" @@ -37,7 +37,7 @@ extern "C" { #endif -#define ZLIB_VERSION "1.1.4" +#define IPCOMP_ZLIB_VERSION "1.1.4" /* The 'zlib' compression library provides in-memory compression and @@ -60,12 +60,12 @@ crash even in case of corrupted input. */ -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); +typedef voidpf (*ipcomp_alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*ipcomp_free_func) OF((voidpf opaque, voidpf address)); -struct internal_state; +struct ipcomp_internal_state; -typedef struct z_stream_s { +typedef struct ipcomp_z_stream_s { Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total nb of input bytes read so far */ @@ -75,18 +75,18 @@ uLong total_out; /* total nb of bytes output so far */ const char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ + struct ipcomp_internal_state FAR *state; /* not visible by applications */ - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ + ipcomp_alloc_func zalloc; /* used to allocate the internal state */ + ipcomp_free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: ascii or binary */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ -} z_stream; +} ipcomp_z_stream; -typedef z_stream FAR *z_streamp; +typedef ipcomp_z_stream FAR *ipcomp_z_streamp; /* The application must update next_in and avail_in when avail_in has @@ -100,7 +100,7 @@ memory management. The compression library attaches no meaning to the opaque value. - zalloc must return Z_NULL if there is not enough memory for the object. + zalloc must return IPCOMP_Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. @@ -122,83 +122,83 @@ /* constants */ -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 +#define IPCOMP_Z_NO_FLUSH 0 +#define IPCOMP_Z_PARTIAL_FLUSH 1 /* will be removed, use IPCOMP_Z_SYNC_FLUSH instead */ +#define IPCOMP_Z_SYNC_FLUSH 2 +#define IPCOMP_Z_FULL_FLUSH 3 +#define IPCOMP_Z_FINISH 4 /* Allowed flush values; see deflate() below for details */ -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) +#define IPCOMP_Z_OK 0 +#define IPCOMP_Z_STREAM_END 1 +#define IPCOMP_Z_NEED_DICT 2 +#define IPCOMP_Z_ERRNO (-1) +#define IPCOMP_Z_STREAM_ERROR (-2) +#define IPCOMP_Z_DATA_ERROR (-3) +#define IPCOMP_Z_MEM_ERROR (-4) +#define IPCOMP_Z_BUF_ERROR (-5) +#define IPCOMP_Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative * values are errors, positive values are used for special but normal events. */ -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) +#define IPCOMP_Z_NO_COMPRESSION 0 +#define IPCOMP_Z_BEST_SPEED 1 +#define IPCOMP_Z_BEST_COMPRESSION 9 +#define IPCOMP_Z_DEFAULT_COMPRESSION (-1) /* compression levels */ -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_DEFAULT_STRATEGY 0 +#define IPCOMP_Z_FILTERED 1 +#define IPCOMP_Z_HUFFMAN_ONLY 2 +#define IPCOMP_Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ -#define Z_BINARY 0 -#define Z_ASCII 1 -#define Z_UNKNOWN 2 +#define IPCOMP_Z_BINARY 0 +#define IPCOMP_Z_ASCII 1 +#define IPCOMP_Z_UNKNOWN 2 /* Possible values of the data_type field */ -#define Z_DEFLATED 8 +#define IPCOMP_Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ +#define IPCOMP_Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. +IPCOMP_ZEXTERN const char * IPCOMP_ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and IPCOMP_ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateInit OF((ipcomp_z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to + If zalloc and zfree are set to IPCOMP_Z_NULL, deflateInit updates them to use default allocation functions. - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + The compression level must be IPCOMP_Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and + IPCOMP_Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). + deflateInit returns IPCOMP_Z_OK if success, IPCOMP_Z_MEM_ERROR if there was not + enough memory, IPCOMP_Z_STREAM_ERROR if level is not a valid compression level, + IPCOMP_Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (IPCOMP_ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflate OF((ipcomp_z_streamp strm, int flush)); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some @@ -224,21 +224,21 @@ more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + (avail_out == 0), or after each call of deflate(). If deflate returns IPCOMP_Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + If the parameter flush is set to IPCOMP_Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can + If flush is set to IPCOMP_Z_FULL_FLUSH, all output is flushed as with + IPCOMP_Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + random access is desired. Using IPCOMP_Z_FULL_FLUSH too often can seriously degrade the compression. If deflate returns with avail_out == 0, this function must be called again @@ -246,44 +246,44 @@ avail_out), until the flush is complete (deflate returns with non-zero avail_out). - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the + If the parameter flush is set to IPCOMP_Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with IPCOMP_Z_STREAM_END if there + was enough output space; if deflate returns with IPCOMP_Z_OK, this function must be + called again with IPCOMP_Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with IPCOMP_Z_STREAM_END or an error. After + deflate has returned IPCOMP_Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. - Z_FINISH can be used immediately after deflateInit if all the compression + IPCOMP_Z_FINISH can be used immediately after deflateInit if all the compression is to be done in a single step. In this case, avail_out must be at least 0.1% larger than avail_in plus 12 bytes. If deflate does not return - Z_STREAM_END, then it must be called again as described above. + IPCOMP_Z_STREAM_END, then it must be called again as described above. deflate() sets strm->adler to the adler32 checksum of all input read so far (that is, total_in bytes). deflate() may update data_type if it can make a good guess about - the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + the input data type (IPCOMP_Z_ASCII or IPCOMP_Z_BINARY). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been + deflate() returns IPCOMP_Z_OK if some progress has been made (more input + processed or more output produced), IPCOMP_Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + IPCOMP_Z_FINISH), IPCOMP_Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), IPCOMP_Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). */ -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateEnd OF((ipcomp_z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed + deflateEnd returns IPCOMP_Z_OK if success, IPCOMP_Z_STREAM_ERROR if the + stream state was inconsistent, IPCOMP_Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). @@ -291,19 +291,19 @@ /* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateInit OF((ipcomp_z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + the caller. If next_in is not IPCOMP_Z_NULL and avail_in is large enough (the exact value depends on the compression method), inflateInit determines the compression method from the zlib header and allocates all data structures accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + inflate. If zalloc and zfree are set to IPCOMP_Z_NULL, inflateInit updates them to use default allocation functions. - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + inflateInit returns IPCOMP_Z_OK if success, IPCOMP_Z_MEM_ERROR if there was not enough + memory, IPCOMP_Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller. msg is set to null if there is no error message. inflateInit does not perform any decompression apart from reading the zlib header if present: this will be done by inflate(). (So next_in and @@ -311,7 +311,7 @@ */ -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflate OF((ipcomp_z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may some @@ -336,57 +336,57 @@ more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it + call of inflate(). If inflate returns IPCOMP_Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. - If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + If the parameter flush is set to IPCOMP_Z_SYNC_FLUSH, inflate flushes as much output as possible to the output buffer. The flushing behavior of inflate is - not specified for values of the flush parameter other than Z_SYNC_FLUSH - and Z_FINISH, but the current implementation actually flushes as much output + not specified for values of the flush parameter other than IPCOMP_Z_SYNC_FLUSH + and IPCOMP_Z_FINISH, but the current implementation actually flushes as much output as possible anyway. - inflate() should normally be called until it returns Z_STREAM_END or an + inflate() should normally be called until it returns IPCOMP_Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending + IPCOMP_Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all the uncompressed data. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH + be inflateEnd to deallocate the decompression state. The use of IPCOMP_Z_FINISH is never required, but can be used to inform inflate that a faster routine may be used for the single inflate() call. If a preset dictionary is needed at this point (see inflateSetDictionary below), inflate sets strm-adler to the adler32 checksum of the - dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + dictionary chosen by the compressor and returns IPCOMP_Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced - so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + so far (that is, total_out bytes) and returns IPCOMP_Z_OK, IPCOMP_Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed adler32 checksum is equal to that saved by the - compressor and returns Z_STREAM_END only if the checksum is correct. + compressor and returns IPCOMP_Z_STREAM_END only if the checksum is correct. - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + inflate() returns IPCOMP_Z_OK if some progress has been made (more input processed + or more output produced), IPCOMP_Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, IPCOMP_Z_NEED_DICT if a + preset dictionary is needed at this point, IPCOMP_Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect - adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent - (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if no progress is possible or if there was not - enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + adler32 checksum), IPCOMP_Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), IPCOMP_Z_MEM_ERROR if there was not + enough memory, IPCOMP_Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when IPCOMP_Z_FINISH is used. In the IPCOMP_Z_DATA_ERROR case, the application may then call inflateSync to look for a good compression block. */ -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateEnd OF((ipcomp_z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + inflateEnd returns IPCOMP_Z_OK if success, IPCOMP_Z_STREAM_ERROR if the stream state was inconsistent. In the error case, msg may be set but then points to a static string (which must not be deallocated). */ @@ -398,7 +398,7 @@ */ /* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateInit2 OF((ipcomp_z_streamp strm, int level, int method, int windowBits, @@ -409,7 +409,7 @@ fields next_in, zalloc, zfree and opaque must be initialized before by the caller. - The method parameter is the compression method. It must be Z_DEFLATED in + The method parameter is the compression method. It must be IPCOMP_Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size @@ -425,23 +425,23 @@ usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + value IPCOMP_Z_DEFAULT_STRATEGY for normal data, IPCOMP_Z_FILTERED for data produced by a + filter (or predictor), or IPCOMP_Z_HUFFMAN_ONLY to force Huffman encoding only (no string match). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is - tuned to compress them better. The effect of Z_FILTERED is to force more + tuned to compress them better. The effect of IPCOMP_Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate - between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + between Z_DEFAULT and IPCOMP_Z_HUFFMAN_ONLY. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + deflateInit2 returns IPCOMP_Z_OK if success, IPCOMP_Z_MEM_ERROR if there was not enough + memory, IPCOMP_Z_STREAM_ERROR if a parameter is invalid (such as an invalid method). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateSetDictionary OF((ipcomp_z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* @@ -470,15 +470,15 @@ applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + deflateSetDictionary returns IPCOMP_Z_OK if success, or IPCOMP_Z_STREAM_ERROR if a parameter is invalid (such as NULL dictionary) or the stream state is inconsistent (for example if deflate has already been called for this stream or if the compression method is bsort). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateCopy OF((ipcomp_z_streamp dest, + ipcomp_z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. @@ -489,24 +489,24 @@ compression state which can be quite large, so this strategy is slow and can consume lots of memory. - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + deflateCopy returns IPCOMP_Z_OK if success, IPCOMP_Z_MEM_ERROR if there was not + enough memory, IPCOMP_Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being NULL). msg is left unchanged in both source and destination. */ -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateReset OF((ipcomp_z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. The stream will keep the same compression level and any other attributes that may have been set by deflateInit2. - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + deflateReset returns IPCOMP_Z_OK if success, or IPCOMP_Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). */ -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateParams OF((ipcomp_z_streamp strm, int level, int strategy)); /* @@ -522,13 +522,13 @@ a call of deflate(), since the currently available input may have to be compressed and flushed. In particular, strm->avail_out must be non-zero. - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + deflateParams returns IPCOMP_Z_OK if success, IPCOMP_Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, IPCOMP_Z_BUF_ERROR if strm->avail_out was zero. */ /* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateInit2 OF((ipcomp_z_streamp strm, int windowBits)); This is another version of inflateInit with an extra parameter. The @@ -539,58 +539,58 @@ size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. If a compressed stream with a larger window size is given as - input, inflate() will return with the error code Z_DATA_ERROR instead of + input, inflate() will return with the error code IPCOMP_Z_DATA_ERROR instead of trying to allocate a larger window. - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + inflateInit2 returns IPCOMP_Z_OK if success, IPCOMP_Z_MEM_ERROR if there was not enough + memory, IPCOMP_Z_STREAM_ERROR if a parameter is invalid (such as a negative memLevel). msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from reading the zlib header if present: this will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unchanged.) */ -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateSetDictionary OF((ipcomp_z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate - if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + if this call returned IPCOMP_Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the Adler32 value returned by this call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + inflateSetDictionary returns IPCOMP_Z_OK if success, IPCOMP_Z_STREAM_ERROR if a parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + inconsistent, IPCOMP_Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect Adler32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateSync OF((ipcomp_z_streamp strm)); /* Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all + description of deflate with IPCOMP_Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + inflateSync returns IPCOMP_Z_OK if a full flush point has been found, IPCOMP_Z_BUF_ERROR + if no more input was provided, IPCOMP_Z_DATA_ERROR if no flush point has been found, + or IPCOMP_Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateReset OF((ipcomp_z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + inflateReset returns IPCOMP_Z_OK if success, or IPCOMP_Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). */ @@ -605,7 +605,7 @@ utility functions can easily be modified if you need special options. */ -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is @@ -615,12 +615,12 @@ compressed buffer. This function can be used to compress a whole file at once if the input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output + compress returns IPCOMP_Z_OK if success, IPCOMP_Z_MEM_ERROR if there was not + enough memory, IPCOMP_Z_BUF_ERROR if there was not enough room in the output buffer. */ -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)); /* @@ -630,12 +630,12 @@ destination buffer, which must be at least 0.1% larger than sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. + compress2 returns IPCOMP_Z_OK if success, IPCOMP_Z_MEM_ERROR if there was not enough + memory, IPCOMP_Z_BUF_ERROR if there was not enough room in the output buffer, + IPCOMP_Z_STREAM_ERROR if the level parameter is invalid. */ -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is @@ -648,15 +648,15 @@ This function can be used to decompress a whole file at once if the input file is mmap'ed. - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. + uncompress returns IPCOMP_Z_OK if success, IPCOMP_Z_MEM_ERROR if there was not + enough memory, IPCOMP_Z_BUF_ERROR if there was not enough room in the output + buffer, or IPCOMP_Z_DATA_ERROR if the input data was corrupted. */ typedef voidp gzFile; -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +IPCOMP_ZEXTERN gzFile IPCOMP_ZEXPORT gzopen OF((const char *path, const char *mode)); /* Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level @@ -670,9 +670,9 @@ gzopen returns NULL if the file could not be opened or if there was insufficient memory to allocate the (de)compression state; errno can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ + zlib error is IPCOMP_Z_MEM_ERROR). */ -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +IPCOMP_ZEXTERN gzFile IPCOMP_ZEXPORT gzdopen OF((int fd, const char *mode)); /* gzdopen() associates a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or @@ -685,15 +685,15 @@ the (de)compression state. */ -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + gzsetparams returns IPCOMP_Z_OK if success, or IPCOMP_Z_STREAM_ERROR if the file was not opened for writing. */ -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* Reads the given number of uncompressed bytes from the compressed file. If the input file was not in gzip format, gzread copies the given number @@ -701,7 +701,7 @@ gzread returns the number of uncompressed bytes actually read (0 for end of file, -1 for error). */ -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzwrite OF((gzFile file, const voidp buf, unsigned len)); /* Writes the given number of uncompressed bytes into the compressed file. @@ -709,52 +709,52 @@ (0 in case of error). */ -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); /* Converts, formats, and writes the args to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of uncompressed bytes actually written (0 in case of error). */ -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzputs OF((gzFile file, const char *s)); /* Writes the given null-terminated string to the compressed file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. */ -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +IPCOMP_ZEXTERN char * IPCOMP_ZEXPORT gzgets OF((gzFile file, char *buf, int len)); /* Reads bytes from the compressed file until len-1 characters are read, or a newline character is read and transferred to buf, or an end-of-file condition is encountered. The string is then terminated with a null character. - gzgets returns buf, or Z_NULL in case of error. + gzgets returns buf, or IPCOMP_Z_NULL in case of error. */ -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzputc OF((gzFile file, int c)); /* Writes c, converted to an unsigned char, into the compressed file. gzputc returns the value that was written, or -1 in case of error. */ -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzgetc OF((gzFile file)); /* Reads one byte from the compressed file. gzgetc returns this byte or -1 in case of end of file or error. */ -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzflush OF((gzFile file, int flush)); /* Flushes all pending output into the compressed file. The parameter flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. + error number (see function gzerror below). gzflush returns IPCOMP_Z_OK if + the flush parameter is IPCOMP_Z_FINISH and all output could be flushed. gzflush should be called only when strictly necessary because it can degrade compression. */ -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, +IPCOMP_ZEXTERN z_off_t IPCOMP_ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence)); /* Sets the starting position for the next gzread or gzwrite on the @@ -772,14 +772,14 @@ would be before the current position. */ -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzrewind OF((gzFile file)); /* Rewinds the given file. This function is supported only for reading. gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) */ -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +IPCOMP_ZEXTERN z_off_t IPCOMP_ZEXPORT gztell OF((gzFile file)); /* Returns the starting position for the next gzread or gzwrite on the given compressed file. This position represents a number of bytes in the @@ -788,25 +788,25 @@ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzeof OF((gzFile file)); /* Returns 1 when EOF has previously been detected reading the given input stream, otherwise zero. */ -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file and deallocates all the (de)compression state. The return value is the zlib error number (see function gzerror below). */ -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +IPCOMP_ZEXTERN const char * IPCOMP_ZEXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno + errnum is set to IPCOMP_Z_ERRNO and the application may consult errno to get the exact error code. */ @@ -818,7 +818,7 @@ compression library. */ -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +IPCOMP_ZEXTERN uLong IPCOMP_ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and @@ -827,7 +827,7 @@ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster. Usage example: - uLong adler = adler32(0L, Z_NULL, 0); + uLong adler = adler32(0L, IPCOMP_Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); @@ -835,7 +835,7 @@ if (adler != original_adler) error(); */ -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +IPCOMP_ZEXTERN uLong IPCOMP_ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* Update a running crc with the bytes buf[0..len-1] and return the updated crc. If buf is NULL, this function returns the required initial value @@ -843,7 +843,7 @@ within this function so it shouldn't be done by the application. Usage example: - uLong crc = crc32(0L, Z_NULL, 0); + uLong crc = crc32(0L, IPCOMP_Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); @@ -855,39 +855,39 @@ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: + * and the compiler's view of ipcomp_z_stream: */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateInit_ OF((ipcomp_z_streamp strm, int level, const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateInit_ OF((ipcomp_z_streamp strm, const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT deflateInit2_ OF((ipcomp_z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateInit2_ OF((ipcomp_z_streamp strm, int windowBits, const char *version, int stream_size)); #define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) + deflateInit_((strm), (level), IPCOMP_ZLIB_VERSION, sizeof(ipcomp_z_stream)) #define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) + inflateInit_((strm), IPCOMP_ZLIB_VERSION, sizeof(ipcomp_z_stream)) #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) + (strategy), IPCOMP_ZLIB_VERSION, sizeof(ipcomp_z_stream)) #define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + inflateInit2_((strm), (windowBits), IPCOMP_ZLIB_VERSION, sizeof(ipcomp_z_stream)) -#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ +#if !defined(_IPCOMP_ZUTIL_H) && !defined(NO_DUMMY_DECL) + struct ipcomp_internal_state {int dummy;}; /* hack for buggy compilers */ #endif -ZEXTERN const char * ZEXPORT zError OF((int err)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); +IPCOMP_ZEXTERN const char * IPCOMP_ZEXPORT zError OF((int err)); +IPCOMP_ZEXTERN int IPCOMP_ZEXPORT inflateSyncPoint OF((ipcomp_z_streamp z)); +IPCOMP_ZEXTERN const uLongf * IPCOMP_ZEXPORT get_crc_table OF((void)); #ifdef __cplusplus } #endif -#endif /* _ZLIB_H */ +#endif /* _IPCOMP_ZLIB_H */ diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/zutil.c linux-2.4.34-wt1.wtap/net/ipsec/zlib/zutil.c --- linux-2.4.34-wt1/net/ipsec/zlib/zutil.c 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/zutil.c 2007-02-18 12:23:52 +0100 @@ -9,28 +9,28 @@ #define MY_ZCALLOC -struct internal_state {int dummy;}; /* for buggy compilers */ +struct ipcomp_internal_state {int dummy;}; /* for buggy compilers */ #ifndef STDC extern void exit OF((int)); #endif const char *z_errmsg[10] = { -"need dictionary", /* Z_NEED_DICT 2 */ -"stream end", /* Z_STREAM_END 1 */ -"", /* Z_OK 0 */ -"file error", /* Z_ERRNO (-1) */ -"stream error", /* Z_STREAM_ERROR (-2) */ -"data error", /* Z_DATA_ERROR (-3) */ -"insufficient memory", /* Z_MEM_ERROR (-4) */ -"buffer error", /* Z_BUF_ERROR (-5) */ -"incompatible version",/* Z_VERSION_ERROR (-6) */ +"need dictionary", /* IPCOMP_Z_NEED_DICT 2 */ +"stream end", /* IPCOMP_Z_STREAM_END 1 */ +"", /* IPCOMP_Z_OK 0 */ +"file error", /* IPCOMP_Z_ERRNO (-1) */ +"stream error", /* IPCOMP_Z_STREAM_ERROR (-2) */ +"data error", /* IPCOMP_Z_DATA_ERROR (-3) */ +"insufficient memory", /* IPCOMP_Z_MEM_ERROR (-4) */ +"buffer error", /* IPCOMP_Z_BUF_ERROR (-5) */ +"incompatible version",/* IPCOMP_Z_VERSION_ERROR (-6) */ ""}; -const char * ZEXPORT zlibVersion() +const char * IPCOMP_ZEXPORT zlibVersion() { - return ZLIB_VERSION; + return IPCOMP_ZLIB_VERSION; } #ifdef DEBUG @@ -51,7 +51,7 @@ /* exported to allow conversion of error code to string for compress() and * uncompress() */ -const char * ZEXPORT zError(err) +const char * IPCOMP_ZEXPORT zError(err) int err; { return ERR_MSG(err); diff -urNX dontdiff linux-2.4.34-wt1/net/ipsec/zlib/zutil.h linux-2.4.34-wt1.wtap/net/ipsec/zlib/zutil.h --- linux-2.4.34-wt1/net/ipsec/zlib/zutil.h 2006-03-05 15:18:01 +0100 +++ linux-2.4.34-wt1.wtap/net/ipsec/zlib/zutil.h 2007-02-18 12:23:52 +0100 @@ -10,8 +10,8 @@ /* @(#) $Id: zutil.h,v 1.1.1.1 2002/09/05 03:13:22 ken Exp $ */ -#ifndef _Z_UTIL_H -#define _Z_UTIL_H +#ifndef _IPCOMP_ZUTIL_H +#define _IPCOMP_ZUTIL_H #include "zlib.h" @@ -45,7 +45,7 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] +#define ERR_MSG(err) z_errmsg[IPCOMP_Z_NEED_DICT-(err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err)) @@ -212,14 +212,14 @@ #endif -typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, +typedef uLong (IPCOMP_ZEXPORT *check_func) OF((uLong check, const Bytef *buf, uInt len)); voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); void zcfree OF((voidpf opaque, voidpf ptr)); -#define ZALLOC(strm, items, size) \ +#define IPCOMP_ZALLOC(strm, items, size) \ (*((strm)->zalloc))((strm)->opaque, (items), (size)) -#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) -#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} +#define IPCOMP_ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define IPCOMP_TRY_FREE(s, p) {if (p) IPCOMP_ZFREE(s, p);} -#endif /* _Z_UTIL_H */ +#endif /* _IPCOMP_ZUTIL_H */