Ipv6NdResponder.h Source File

Simu5G: Ipv6NdResponder.h Source File
Simu5G
Ipv6NdResponder.h
1//
2// Simu5G
3//
4// Copyright (C) 2026 Andras Varga (OpenSim Ltd)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef _IPV6_ND_RESPONDER_H_
13#define _IPV6_ND_RESPONDER_H_
14
15#include <inet/common/ModuleRefByPar.h>
16#include <inet/common/checksum/ChecksumMode_m.h>
17#include <inet/common/packet/Packet.h>
18#include <inet/networklayer/contract/ipv6/Ipv6Address.h>
19#include <inet/networklayer/icmpv6/Icmpv6Header_m.h>
20
21#include "simu5g/common/SessionTag_m.h"
22#include "simu5g/common/binder/Binder.h"
23
24namespace simu5g {
25
26using namespace omnetpp;
27
32class Ipv6NdResponder : public cSimpleModule
33{
34 protected:
35 inet::ModuleRefByPar<Binder> binder_;
36 inet::Ipv6Address linkLocalAddress_;
37 simtime_t routerLifetime_;
38 int curHopLimit_ = 0;
39 inet::ChecksumMode checksumMode_ = inet::CHECKSUM_MODE_UNDEFINED;
40
41 int numRouterAdvertisementsSent_ = 0;
42 int numNeighbourAdvertisementsSent_ = 0;
43 int numDiscarded_ = 0;
44
45 protected:
46 void initialize() override;
47 void handleMessage(cMessage *msg) override;
48
49 virtual void answerRouterSolicitation(const inet::Ipv6Address& ueAddress, const SessionTag& session);
50 virtual void answerNeighbourSolicitation(const inet::Ipv6Address& ueAddress, const SessionTag& session);
51 virtual void sendToUe(const char *name, const inet::Ptr<inet::Icmpv6Header>& icmpMessage, const inet::Ipv6Address& ueAddress, const SessionTag& session);
52 virtual void consume(inet::Packet *pkt, const char *what); // the protocol wants no answer
53 virtual void discard(inet::Packet *pkt, const char *reason); // this module cannot handle it
54};
55
56} // namespace simu5g
57
58#endif
Definition Ipv6NdResponder.h:33
Definition AlertReceiver.h:24