File: AnonConstOverwriteRange.h

package info (click to toggle)
pktanon 2~git20160407.0.2bde4f2%2Bdfsg-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,592 kB
  • sloc: cpp: 5,509; xml: 828; exp: 767; makefile: 121; ansic: 16; sh: 12
file content (36 lines) | stat: -rw-r--r-- 1,001 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
 * Copyright (c) 2014, Institute of Telematics, Karlsruhe Institute of Technology.
 *
 * This file is part of the PktAnon project. PktAnon is distributed under 2-clause BSD licence.
 * See LICENSE file found in the top-level directory of this distribution.
 */

#ifndef PKTANON__ANONCONSTOVERWRITERANGE_H
#define PKTANON__ANONCONSTOVERWRITERANGE_H

#include "AnonPrimitive.h"
#include <cstdint>

namespace pktanon
{

class AnonConstOverwriteRange : public AnonPrimitive
{
public:
  static AnonConstOverwriteRange* construct ( const pktanon::Params& params );

  AnonConstOverwriteRange ( int range_begin,  int range_length,  uint8_t value );
  virtual ~AnonConstOverwriteRange();

protected:
  virtual ANON_RESULT anonymize_chain ( void* buf, unsigned int len ) const;
  virtual ANON_RESULT anonymize_internal ( const void*const src_buff, void* dst_buff, unsigned int len ) const;

private:
  int range_begin;
  int range_length;
  uint8_t value;
};
}

#endif // PKTANON_ANONCONSTOVERWRITERANGE_H