Newer
Older
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "LibItsIpv6OverGeoNetworking_Functions.hh"
#include <time.h>
#include <math.h>
namespace LibItsIpv6OverGeoNetworking__Functions
{
/* * @desc Calculate ICMPv6 checksum on pseudo header according RFC 4443 - Clause 2.3
* @param p_sourceAddress Source address,
* @param p_destinationAddress Destination address
* @param p_payloadLength Upper-Layer Packet Length
* @param p_payload Upper-Layer payload
* @param p_nextHdr Next header value (e.g. 0x3a for ICMPv6)
* @return The checksum value
* <pre>
* Pseudo header is defined by RFC 2460 - Clause 8.1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* + +
* | |
* + Source Address +
* | |
* + +
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* + +
* | |
* + Destination Address +
* | |
* + +
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Upper-Layer Packet Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | zero | Next Header |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* </pre>
external function fx_computeIPv6CheckSum(
in template (value) Ipv6Address p_sourceAddress,
in template (value) Ipv6Address p_destinationAddress,
in template (value) integer p_payloadLength,
in template (value) octetstring p_payload,
in template (value) UInt8 p_nextHdr
) return Oct2;
*/
OCTETSTRING fx__computeIPv6CheckSum(
const OCTETSTRING_template& p__sourceAddress,
const OCTETSTRING_template& p__destinationAddress,
const INTEGER_template& p__payloadLength,
const OCTETSTRING_template& p__payload,
const INTEGER_template& p__nextHdr
) {
OCTETSTRING ret_val = int2oct(0,1);
return ret_val;
}
} //end namespace