StoreMetaUnpacker.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef SQUID_TYPELENGTHVALUEUNPACKER_H
10 #define SQUID_TYPELENGTHVALUEUNPACKER_H
11 
12 class StoreMeta;
13 class StoreEntry;
14 
16 {
17 
18 public:
19  StoreMetaUnpacker (const char *buf, ssize_t bufferLength, int *hdrlen);
21  bool isBufferZero();
22  void checkBuffer();
24 
25 private:
26  static int const MinimumBufferLength;
27 
28  void getBufferLength();
29  void getType();
30  void getLength();
31  void getTLV();
32  bool doOneEntry();
33  bool moreToProcess() const;
34 
35  char const * const buf;
36  ssize_t buflen;
37  int *hdr_len;
38  int position;
39  char type;
40  int length;
42 };
43 
44 /*
45  * store_swapmeta.c
46  */
47 char *storeSwapMetaPack(StoreMeta * tlv_list, int *length);
49 StoreMeta *storeSwapMetaUnpack(const char *buf, int *hdrlen);
50 void storeSwapTLVFree(StoreMeta * n);
51 StoreMeta ** storeSwapTLVAdd(int type, const void *ptr, size_t len, StoreMeta ** tail);
52 
53 #endif /* SQUID_TYPELENGTHVALUEUNPACKER_H */
54 
StoreMeta * createStoreMeta()
char * storeSwapMetaPack(StoreMeta *tlv_list, int *length)
int type
Definition: errorpage.cc:79
bool moreToProcess() const
bool isBufferZero()
useful for meta stored in pre-initialized (with zeros) db files
void storeSwapTLVFree(StoreMeta *n)
static int const MinimumBufferLength
StoreMetaUnpacker(const char *buf, ssize_t bufferLength, int *hdrlen)
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
void checkBuffer()
validates buffer sanity and throws if validation fails
void const char * buf
Definition: stub_helper.cc:16
StoreMeta * storeSwapMetaBuild(StoreEntry *e)
StoreMeta ** storeSwapTLVAdd(int type, const void *ptr, size_t len, StoreMeta **tail)
char const *const buf
StoreMeta * storeSwapMetaUnpack(const char *buf, int *hdrlen)

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors