Custom Search

Tuesday, July 7, 2015

contrail ifmap-python-client

ifmap official repo:
https://github.com/ITI/ifmap-python-client
https://github.com/ITI/ifmap-python-client/blob/master/ifmap/client.py

Contrail builds ifmap-python-client from above repo and apply some patches:
https://github.com/Juniper/contrail-packages/tree/master/debian/ifmap-python-client/debian
https://github.com/Juniper/contrail-packages/tree/master/debian/ifmap-python-client/debian/patches

Contrail keeps patches in this repo:
https://github.com/Juniper/contrail-third-party
https://github.com/Juniper/contrail-third-party/blob/master/ifmap-python-async.patch

Notes:
https://github.com/sajuptpm/mytools/blob/master/opc/ifmap/api_server_and_ifmap_client.txt

ifmap Poll and subscribe
-----------------

a)
schema-transformer poll from ifmap:
contrail-controller/src/config/schema-transformer/to_bgp.py:

b)
svc_monitor poll from ifmap:
contrail-controller/src/config/svc-monitor/svc_monitor/svc_monitor.py

c)
controller poll from ifmap:
contrail-controller/src/ifmap/client/ifmap_state_machine.cc <=== Contains ifmap client code
contrail-controller/src/ifmap/client/ifmap_channel.cc <=== contains code which set namespaces
contrail-controller/src/ifmap/client/test/ifmap_state_machine_test.cc

d)
contrail control ifmap poll, subscribe code:
contrail-controller/src/ifmap/client/ifmap_channel.cc
* Search for contrail:config-root:root

* void IFMapChannel::SendSubscribe()
* void IFMapChannel::SubscribeResponseWait()
* int IFMapChannel::ReadSubscribeResponseStr()

* void IFMapChannel::SendPollRequest()
* void IFMapChannel::PollResponseWait()
* int IFMapChannel::ReadPollResponse()

e)
Also check
contrail-controller/src/ifmap/client/ifmap_state_machine.cc

* struct SendSubscribe : sc::state {
* struct SubscribeResponseWait :

* struct ArcConnect : sc::state
* struct ArcSslHandshake : sc::state {

* struct SendPoll : sc::state {
* struct PollResponseWait :

* IFMapStateMachine::IFMapStateMachine(IFMapManager *manager)

f)
Find diff
------------
sudo apt-get install xmllint
xmllint --format dump1.xml > new_dump1.xml
xmllint --format dump2.xml > new_dump2.xml

vimdiff new_dump1.xml new_dump2.xml

g)

4 comments:

  1. Notes:
    https://github.com/sajuptpm/mytools/blob/master/opc/ifmap/api_server_and_ifmap_client.txt

    ReplyDelete
  2. IFMAP Poll
    -----------------
    a)
    schema-transformer poll from ifmap:
    contrail-controller/src/config/schema-transformer/to_bgp.py:

    b)
    svc_monitor poll from ifmap:
    contrail-controller/src/config/svc-monitor/svc_monitor/svc_monitor.py

    c)
    controller poll from ifmap:
    contrail-controller/src/ifmap/client/ifmap_state_machine.cc <=== Contains ifmap client code
    contrail-controller/src/ifmap/client/ifmap_channel.cc <=== contains code which set namespaces
    contrail-controller/src/ifmap/client/test/ifmap_state_machine_test.cc

    d)
    contrail control ifmap poll, subscribe code:
    contrail-controller/src/ifmap/client/ifmap_channel.cc
    * Search for contrail:config-root:root

    * void IFMapChannel::SendSubscribe()
    * void IFMapChannel::SubscribeResponseWait()
    * int IFMapChannel::ReadSubscribeResponseStr()

    * void IFMapChannel::SendPollRequest()
    * void IFMapChannel::PollResponseWait()
    * int IFMapChannel::ReadPollResponse()

    ReplyDelete
  3. Also check
    contrail-controller/src/ifmap/client/ifmap_state_machine.cc

    * struct SendSubscribe : sc::state {
    * struct SubscribeResponseWait :

    * struct ArcConnect : sc::state
    * struct ArcSslHandshake : sc::state {

    * struct SendPoll : sc::state {
    * struct PollResponseWait :

    * IFMapStateMachine::IFMapStateMachine(IFMapManager *manager)

    ReplyDelete
  4. Find diff
    ------------
    sudo apt-get install xmllint
    xmllint --format dump1.xml > new_dump1.xml
    xmllint --format dump2.xml > new_dump2.xml

    vimdiff new_dump1.xml new_dump2.xml

    ReplyDelete