So, guys, we are planning to implement this table and the function us install LSP.
So let us first integrate this API.
ISIS install LSP in upward.
When I say integrate, it means that let us first place the invocation of this API at appropriate places
in our protocol code and then we will going to implement this table as a in the body part of this API.
All right.
So let us revisit this diagram.
In this diagram, you can see that I install LSP API needs to be invoked from two different places in
the protocol code.
One place is the one when your protocol receives the link state packet interface and another invocation
would be when your protocol John Ridge, the fresh LSP packet from scratch.
All right.
And both the scenarios we need to make the invocation of API, ISIS and start LSP.
So let us do the groundwork and let us integrate this API with our protocol code and then we will look
after to how to implement the body part of this API.
All right.
So guys, we will going to provide the declaration of the API in the file ISIS and as GB detach, as
you can see that the API takes three argument.
The first argument is a pointer to the node on which the packet LSP packet is being received.
The second argument represent the interface on which the packet has arrived.
This is called in-coming interface, and the third argument is a pointer to the LSP packet, which the
node is trying to install in its local linker state database.
Obviously, this new link straight back it could be the packet which the node has received over the
interface, or this new links to a packet could be the packet puts.
The node has self-generated and that is the incoming interface.
We're going to be null.
So let us provide the implementation of this API in the file ISIS LSD we don't see.
And now let me play is the invocation of this API, as we discussed on the diagram that ISIS install
LSP API needs to be invoked as soon as the protocols create its fresh links packet.
So here in the function, ISIS generate LSP packet in line number 337, our protocol has created its
fresh links to it packet from scratch and in line number 338.
Our protocol has cued up the links to packet for flooding.
Now, the next thing that we need to do is to install this API in the to state database.
All right.
So this is the first placement of this API.
The second placement of the API needs to be placed at a point when the protocol receives the links to
packet over an interface.
So in this case, if you revisit the function as as packet receive, we have two cases when the protocol
receives the handle packet and the protocol receives the LSP packet.
So the function assigns process al-Azzawi packages.
The function was the protocol uses to process and receive the link step backward.
So here this is not a hello internet header, but it is LSP internet header.
All right.
So the third argument to this API is a pointer to the internet header of the links to a packet which
the protocol has received.
So we need to play as the second invocation of the API here that is ISIS install LSP.
But here we don't have a LSP package to structure, so we need to create a new one.
But before receiving the links to package, the protocol has to place certain sanity checks.
Whether the protocol should really process the link stripped back it or not is the question in the first
place.
So if
protocol is not even enable on the interface on was the LSP packet has arrived and we did not do anything.
Just ignore the packet.
And the protocol should not process the link straight back it, if the interface on was the link straight
packet has arrived, do not have an agency or it has an agency, but that it does and is not an apostate,
then in that case, also the protocol should ignore the link step packet.
And after doing all the sanity checks, we need to invoke an API, our size and style LSP.
So for that, we need to malloc a new ISIS LSP packet data structure so that we can hold the wired form
of the links to a packet that has arrived over an interface.
All right.
So take a buffer which can store the packet bytes and then simply copy the packet bytes into this link,
step back and buffer along with the packet size, and finally invoke an API our size and style LSP.
All right.
So this is the placement of the second invocation of the function, our size and style LSP, and we
are done with the API implementation.
All right.
We need to malaak the Asus LSP packet type data structure so that we can store the actual wild form
of the link step packet input as a structure along with the packet size and invoke the essential LSP
API.
All right.
So in a way, we are in compliance with this diagram.
We are in walking Eisenstein LSP API to handle both the scenarios.
All right.
And now we are in a position to start implementation of the body part of this Asus install LSP API and
Asus Install LSP API.
We will going to implement this table and then we will going to implement another table, which handles
the installation of the remote links dead packets in the local links to a database of A..