vxlan-SDK-nsx_integration-vxlan_xorp

########## SDK APIs ##########
/**
* Create a VXLAN vpn. 这个是从set vxlan vni 100中设置的。
*
* @param vnid VXLAN network ID.
* @param vpn_id a unique id of a specific VXLAN vpn.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_create_vxlan_vpn(const uint32_t vnid, uint32_t &vpn_id)


/**
* Delete a VXLAN vpn.
*
* @param vpn_id a unique id of a specific VXLAN vpn.
*
* @return true  on success or not found,
*         false on failure.
*/
bool
pica_delete_vxlan_vpn(const uint32_t vpn_id)


/* Pica tunnel initiator */
#define PICA_TUNNEL_INIT_IP6        (1 << 0)
#define PICA_TUNNEL_INIT_WITH_ID    (1 << 1)
#define PICA_TUNNEL_INIT_SET_VLAN   (1 << 2)
#define PICA_TUNNEL_INIT_SET_TTL    (1 << 3)
#define PICA_TUNNEL_INIT_SET_MTU    (1 << 4)
typedef struct {
    uint32_t    flags;      /* Tunnel initiator control flag, PICA_TUNNEL_INIT_XXX */
    int32_t     tunnel_id;  /* Tunnel id 对vxlan就是VNI */
    mac_t       src_mac;    /* Tunnel initiator encap header source MAC 对vxlan就是外层pkt的SMAC,这个可能会从路由中取得吗???不会,是从tp中配置的,参看set vxlan source-interface loopback { address: 1.1.1.1 } */
    mac_t       dst_mac;    /* Tunnel initiator encap header destination MAC  但是DIP不知道从哪里来,按理说应该是从ucast-macs-remote表中来,所以要去看那个API来确定 */
    uint32_t    tpid;       /* Tunnel initiator encap header tpid 外层封装pkt的TPID */
    uint32_t    vlan;       /* Tunnel initiator encap header vlan id 外层封装pkt的VID */
    ipv4_addr_t sip4;       /* Tunnel initiator encap header source ipv4 address */
    ipv4_addr_t dip4;       /* Tunnel initiator encap header destination ipv4 address */
    ipv6_addr_t sip6;       /* Tunnel initiator encap header source ipv6 address */
    ipv6_addr_t dip6;       /* Tunnel initiator encap header destination ipv6 address */
    uint32_t    udp_sport;  /* Tunnel initiator encap header udp source port */
    uint32_t    udp_dport;  /* Tunnel initiator encap header udp destination port 这个应该是从tp的配置udp-port中获得,默认是4789 */
    uint32_t    ttl;        /* Tunnel initiator encap header ttl */
    uint32_t    mtu;        /* WLAN/VXLAN mtu */
} pica_tunnel_initiator_t;所有tunnel都定义成这个结构了,所以对vxlan也是只有部分成员有用, 具体哪些有用还要看代码流程
typedef pica_tunnel_initiator_t     pica_wlan_tunnel_initiator_t;
typedef pica_tunnel_initiator_t     pica_vxlan_tunnel_initiator_t;
typedef pica_tunnel_initiator_t     pica_l2gre_tunnel_initiator_t;
/**
* Add VXLAN tunnel initiator on a specific L3 interface.
*
* @param initiator the VXLAN tunnel initiator, all member are input param,
*                  except tunnel_id is output param.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_add_vxlan_tunnel_initiator(pica_vxlan_tunnel_initiator_t& initiator)


/**
* Delete VXLAN tunnel initiator.
*
* @param tunnel_id the tunnel id returned by _add api.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_delete_vxlan_tunnel_initiator(const int32_t tunnel_id)


/**
* Add VXLAN tunnel terminator.
*
* @param terminator the VXLAN tunnel terminator, member tunnel_id should
*                   be the same as corresponding tunnel_initiator, member sip,
*                   dip should be dip, sip of initiator respectively.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_add_vxlan_tunnel_terminator(
        const pica_vxlan_tunnel_terminator_t& terminator)


/**
* Delete VXLAN tunnel terminator.
*
* @param tunnel_id the tunnel id returned by _add api.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_delete_vxlan_tunnel_terminator(const int32_t tunnel_id)


/**
* Create a VXLAN access port.
*
* @param vpn_id a unique id of a specific VXLAN vpn. 感觉这个vpn_id就相当于logical_switch的id就是VNI就是vxlan的ID。
* @param port_id a physical port or a lag.
* @param vlan_id matching vlan id, or 0 if not used.
@param egr_id l3 egress interface id. ???这个只能看code
@param id the returned id of the access port. 这个应该也是属于L3 interface,这个还是要看SDK中port设置才懂,后面的都有这个疑问。
*
* @return true  on success,
*         false on failure.
*/
bool
pica_create_vxlan_access_port(const uint32_t vpn_id, const usp_t &port_id,
                              const uint32_t vlan_id, const uint32_t egr_id,
                              int32_t &id)


/**
* Delete a VXLAN access port.
*
* @param vpn_id a unique id of a specific VXLAN vpn.
* @param id the id of the access port.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_delete_vxlan_access_port(const uint32_t vpn_id, const int32_t id)


/**
* Create a VXLAN network port.
*
* @param vpn_id a unique id of a specific VXLAN vpn.
* @param port_id a physical port or a lag.
* @param egr_id l3 egress interface id.
* @param tunnel_id the tunnel id of VXLAN tunnel initiator/terminator.
* @param multicast multicast capability.
* @param id the returned id of the network port.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_create_vxlan_network_port(const uint32_t vpn_id, const usp_t &port_id,
                               const uint32_t egr_id, const int32_t tunnel_id,
                               const bool multicast, int32_t &id)


/**
* Delete a VXLAN network port.
*
* @param vpn_id a unique id of a specific VXLAN vpn.
* @param id the id of the network port.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_delete_vxlan_network_port(const uint32_t vpn_id, const int32_t id)


/**
* Create vxlan default network port.
*
* @param port_id a physical port or a lag.
* @param tunnel_id the tunnel id of VXLAN tunnel initiator/terminator.
* @param egr_id l3 egress interface id.
* @param id the returned id of the default network port.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_create_vxlan_default_network_port(const usp_t &port_id,
                                       const int32_t tunnel_id,
                                       const uint32_t egr_id, int32_t &id)


/**
* Delete VXLAN default network port.
*
* @param id the id of the default network port.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_delete_vxlan_default_network_port(const int32_t id)


/**
* Class Usp definition, usp means (unit, slot, port) pair,
* it's used to define a logical port (include physical port,
* logical lag port, logical vlan port).
*/
class Usp 
typedef Usp                 usp_t;
/**
Set port VXLAN termination admin state. 什么叫termination admin state???可能是说这个port(这里说是logical port,也包括physical port,我们一般使用physical port例如TE-1/1/1)是否作为vxlan access port???如果作为access port那么会有某些属性与正常的port不同。
gavin解释: termination admin state是指这个port作为tunnel的termination,就是如果是true则收到tunnel的数据包之后就解封装;如果是false那么就按照外层封装的数据包转发。
再启动过程中,首先设置所有的物理port都是true,然后设置vxlan的access port是false。至于为什么设置成false还要再看???
*
@param enable the admin state of port's vxlan termination functionality. 没看懂???
*
* @return true  on success,
*         false on failure.
*/
bool
pica_set_port_vxlan_termination_admin_state(const usp_t& port_id,
                                            const bool enable)


/**
* Set port VXLAN termination admin state.
*
* @param ports the list of physical port id.
* @param enable the admin state of port's vxlan termination functionality.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_set_ports_vxlan_termination_admin_state(const usp_list_t& ports,
                                             const bool enable)


/**
* Get port VXLAN termination admin state.
*
* @param enabled the admin state of port's vxlan termination functionality.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_get_port_vxlan_termination_admin_state(const usp_t& port_id, bool& enabled)


/**
* 不知道为什么要 Set system VXLAN udp destination port. 估计是给vxlan这个tunnel设置本地的UDP端口,参加RFC,默认是有一个UDP端口4789,可以设置。
*
* @param udp_dport udp destination port of VXLAN tunnel ip header.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_set_system_vxlan_udp_destination_port(const uint32_t udp_dport)


/**
* Get system VXLAN udp destination port.
*
* @param udp_dport udp destination port of VXLAN tunnel ip header.
*
* @return true  on success,
*         false on failure.
*/
bool
pica_get_system_vxlan_udp_destination_port(uint32_t& udp_dport)


/**
* Set system admin state for VXLAN udp source port used as  entropy(what's entropy???).参考RFC7346中entropy的定义,看似是定义在source udp port,类似ECMP的做LB使用的。如果定义了entropy呢么就会按照RFC来做hash,如果没有定义entropy,udp SP会变成什么还要测试才知道。
*
* @param enable enable udp source port used as VXLAN entropy.
*
* @return true  on success or not available,
*         false on failure.
*/
bool
pica_set_system_vxlan_entropy_admin_state(const bool enable)


/**
* Get system admin state for VXLAN udp source port used as entropy.
*
* @param enabled admin state of udp source port used as VXLAN entropy.
*
* @return true  on success or not available,
*         false on failure.
*/
bool
pica_get_system_vxlan_entropy_admin_state(bool &enabled)


########## 猜测的pipeline ###########
1. 在端口上面创建bind,创建access port:
pica_XXX_vxlan_access_port(const uint32_t vpn_id, const usp_t &port_id,
                              const uint32_t vlan_id, const uint32_t egr_id,
                              int32_t &id)
vpn_id可能是已经创建好的vtep的ID,参见vtep的创建。也可能是VNI。这个很不确定。
port_id是物理port。
vlan_id是vlan的VID,也可能是vlan interface的ID,这个看具体流程了。
egr_id???
id是返回的id。
可能在SDK中对所有的port(逻辑、物理)都是统一按照id管理。
在这里添加好bind关系之后,会有专门的模块抓取符合access port特征的数据包,送到vtep那边进行封装。

2. 创建network port:
pica_create_vxlan_network_port(const uint32_t vpn_id, const usp_t &port_id,
                               const uint32_t egr_id, const int32_t tunnel_id,
                               const bool multicast, int32_t &id)
vpn_id可能是已经创建好的vtep的ID,参见vtep的创建。也可能是VNI。这个很不确定。
tunnel_id:the tunnel id of VXLAN tunnel initiator/terminator.。
egr_id???
multicast???
id是返回的id。

3. 创建vtep,专门用于封装数据包的虚拟端口
pica_create_vxlan_vpn(const uint32_t vnid, uint32_t &vpn_id)
pica_add_vxlan_tunnel_initiator(pica_vxlan_tunnel_initiator_t& initiator)

4. Asic猜测:
·从access port进来的报文,符合条件的被送上step3创建的vtep进行封装,出来的时候走路由,不一定从network port出去。
·从network port进来的vxlan封装的报文,符合条件的送上vtep解封装,出来的时候走L2 table,不一定从access port出去。


############ nsx_integration ############
1. pica_nsx包括三个进程:
· run show XXX 调用的 /tool/show_ovsdb,这个就是读取ovsdb然后show出来。
· 通过配置TP文件调用的xrl_nsx_target模块的API,这个怎么调用过去的还要看。个人估计是:输入co之后会进入shell,这里不需要通过rpc直接调用到API。这个模块就是用来配置rtrmgr,进而配置到switch。另一方面也调用到自己写的ovsdb API。
· pica_nsx自启动的进程,这个进程中启动了:
     · rtrmgr client,用于向rtrmgr注册并发送tp delta。这些delta见下面说的tp转换。
     · ovsdb等ovsdb部分程序,算作其他的进程

2. 通过配置TP tree调用命令,见tp文件。
· set vxlan vni 100 interface te-1/1/1 对应的 create_vxlan_vpn_interface 还不太清楚???
· set vxlan vni 100 flood bfd 不清楚???
· traffic-type ???
· 注意这个flood vtep @ipv4 mac @mac 就是ucast-macs-remote
· 注意下面trceoption是取反的。


########### tp转换 ###########
1. 基本流程是在show_unannotated_tree的时候将DB中的变化转换成tp的delta;再在被调用到commit的时候将转换的delta提交出去。
2. 转换函数就是show_unannotated_tree,包括三步骤:
· 转换interface的bind
· 转换mcast-macs-remote表中的vtep,这一步与我的做法不同,这个要看152环境确定。按理说这张表是确定BUM报文的remote IP的,这里不懂怎么做???据说是在nsx中设置了service gateway就会在mcast-macs-remote表中有一项。然后这边把这一项看做BUM的remote vtep IP。
· 转换ucast-macs-remote,这个就是远端mac+IP
· 每个转换都包括delete和delta,这个存在于剩下的两个类中
3. 在show_unannotated_tree最后会有commit动作。


########### cli client ############
1. nsx integration中的cli client采用组合的方式使用了XrlRtrmgrV0p1Client类作为向rtrmgr进行远程操作配置文件的接口。
理解client的注册、修改配置文件的过程比较重要。主要使用了:
_rtrmgr_client.send_register_client     这是注册client,如果成功会回调一个函数
_rtrmgr_client.send_authenticate_client
_rtrmgr_client.send_unregister_client     stop的时候调用的
_rtrmgr_client.send_lock_config     可能是在修改config文件之前要先lock这个config文件
_rtrmgr_client.send_unlock_config
_rtrmgr_client.send_apply_config_change     这个应该是tp delta,所有tp的delta都是通过这个发送出去的
_rtrmgr_client.send_apply_config_change_without_lock

综上,这个cli client主要就是发送tp delta给rtrmgr,成员变量:
private:
    NsxConfig& _nsx_config;     干活的类
    EventLoop& _eventloop;     事件类
    XrlRtrmgrV0p1Client& _rtrmgr_client;     rtrmgr标准客户端

    string _ipc_name;     初始化的时候赋值的rtrmgr IPC
    string _authfile;          认证之后的认证文件
    string _authtoken;     认证之后传来的认证token
   
    uint32_t _rtrmgr_pid;
    uint32_t _clientid;

    bool _xrl_generic_done;  // XRL startup/shutdown flag
    bool _authentication_done;

    list<string> _delta_list;     这俩好像没用
    list<string> _deletion_list;

    XorpTimer _lock_timer;
    XorpTimer _commit_timer;

    bool _committing;
    bool _locked;
其中只有如下三个API在外部有使用:
CliClient::start     将本程序作为客户端注册到rtrmgr
     _rtrmgr_client.send_register_client
          CliClient::send_register_client_response     回调函数发来如下三个
               _authfile = *file_name
               _rtrmgr_pid = *pid
               _clientid = *clientid;
     成功的话会发来一个authority file
      然后unlink???
     然后认证这个file     _rtrmgr_client.send_authenticate_client
          CliClient::send_authenticate_client_response
               _xrl_generic_done = true;
              _authentication_done = true;     后面有一个_eventloop.run是等到这个为真才继续
               如果delta非空,就开始commit,但这个是异步的,不是block在这里

CliClient::stop     撤销注册
     _rtrmgr_client.send_unregister_client
          CliClient::send_unregister_client_response
           循环等待unregister成功,看来只要是注册了callback就能一直在_eventloop.run???这个event还是不太懂,要再看看。可以想象eventloop就是专门处理IPC                                事件的。这里使用eventloop有两种方法,一种是xrl那边发送xrl请求相当于IPC,一种是自定义eventloop多长时间调用一次callback函数。

CliClient::start_commit
     send_lock_config     
          _rtrmgr_client.send_lock_config
               CliClient::send_lock_config_response     注意这里有_eventloop.new_oneoff_after_ms(CliClient::send_lock_config)
                    send_apply_config_change     这里commit change
                         _rtrmgr_client.send_apply_config_change     发送front的delta与delete,同时
                              CliClient::send_apply_config_change_response
                                   send_unlock_config
                                        send_unlock_config_response     如果在提交这一段事件之内又有要提交的东西,那么继续提交。


######### 以下code何时block的 ##########
while (!nsx_config.is_shutdown_received()) {
            eventloop.run();
            vtep_run();
        }
个人猜测是应该还是在run里面block的。例如在上面startup的时候注册了func1,在vtep_run中又注册了func2。那么在运行到eventloop.run的时候会阻塞,等到最近要发生的func。


########### jsonrpc对socket的操作类似于ReSiprocate协议栈 ############
· 同样是上层在系统中创建socket,系统socket负责维护底层通信。
· 上层只是在被调用到的时候查看底层的结果,基本不会block在那里等待:
     · 可能使用事件机制,来事件之后才会唤醒。
     · 也可能只是查询机制,查询socket是否有收到报文,这样不会睡眠。


########### 看bug3264log ############
1.  2014-12-18 13:23:38 CST
这些是purl负责解析的
· 添加ovsdb.tp。参看tp文件,主要用于设置controller IP等、使用的interface、trace option。类似于ovsdb。
这个tp文件与vxlan的tp文件一样,调用到xrl_nsx_target中的API了。

· 添加ovsdb.xif。这个是与ovsdb.tp对应的,例如
%create: xrl "$(ovsdb.targetname)/ovsdb/0.1/set_controller?name:txt=$(@)&protocol:txt=$(@.protocol)&address:ipv4=$(@.address)&port:u32=$(@.port)";
对应到xif文件中是
interface ovsdb/0.1 {
     set_controller ? name:txt & protocol:txt & address:ipv4 & port:u32
}

· nsx_integration.tgt。这是将多个xif文件组合成一个模块然后生成nsx_integration_base.XX文件用于后面继承。

· 相应的还要更改makefile、pica_target_names.hh等文件:
sam.gang@dev-20:~/pica8/branches/1.1$ svn diff -r19140:17863 ./pica/Makefile.am
-SUBDIRS +=  lacp lldp mstp system snmp dhcp igmpsnooping shell dot1x
+SUBDIRS +=  lacp lldp mstp system snmp dhcp igmpsnooping shell dot1x nsx_integration 增加nsx_integration模块

 DIST_SUBDIRS   = lib picaxrl libsifclient cli license policy sif cardmgr etc \
                  include lacp lldp mstp system snmp dhcp lcmgr/dist \
-                 igmpsnooping shell libxovs dot1x
+                 igmpsnooping shell libxovs dot1x nsx_integration 增加nsx_integration模块

sam.gang@dev-20:~/pica8/branches/1.1$ svn diff -r19005:19140 ./pica/configure.in           
Index: pica/configure.in
===================================================================
--- pica/configure.in   (revision 19005)
+++ pica/configure.in   (revision 19140)
@@ -1808,6 +1808,7 @@
     dot1x/Makefile
        dot1x/tools/Makefile
     libxovs/Makefile
+    nsx_integration/Makefile 增加nsx_integration模块的Makefile
])

sam.gang@dev-20:~/pica8/branches/1.1$ svn diff -r18991:19140 ./pica/etc/templates/Makefile.am      
Index: pica/etc/templates/Makefile.am
===================================================================
--- pica/etc/templates/Makefile.am      (revision 18991)
+++ pica/etc/templates/Makefile.am      (revision 19140)
@@ -83,11 +83,13 @@
if BUILD_PRONTO_5401
data_DATA    += common/vxlan.tp
data_DATA    += common/vxlan.cmds
+data_DATA    += common/ovsdb.tp     这个后面再看,???
endif

if BUILD_PRONTO_5101
data_DATA    += common/vxlan.tp
data_DATA    += common/vxlan.cmds
+data_DATA    += common/ovsdb.tp
endif

sam.gang@dev-20:~/pica8/branches/1.1$ svn diff -r17863:19140 ./pica/include/pica_target_names.hh     
Index: pica/include/pica_target_names.hh
===================================================================
--- pica/include/pica_target_names.hh   (revision 17863)
+++ pica/include/pica_target_names.hh   (revision 19140)
@@ -64,6 +64,7 @@
const string pica_rip_target_name        = "rip";
const string pica_vxlan_target_name      = "vxlan";
const string pica_dot1x_target_name     = "dot1x";
+const string pica_nsx_integration_target_name = "nsx_integration";     作为nsx模块的字符串标记用于其他代码,用法pica_nsx_integration_target_name.c_str(),

#define PICA_XORP_LOGGING_MODULES      30
const string pica_xorp_logging_modules[]       = {
@@ -96,7 +97,8 @@
     "openvswitch",
     "bgp",
     "udld",
-    "dot1x"
+    "dot1x",
+    "nsx_integration"     应该是打印log的时候输出的字符串
};

sam.gang@dev-20:~/pica8/branches/1.1$ svn diff -r18992:19140 ./pica/picaxrl/interfaces/Makefile.am     
Index: pica/picaxrl/interfaces/Makefile.am
===================================================================
--- pica/picaxrl/interfaces/Makefile.am (revision 18992)
+++ pica/picaxrl/interfaces/Makefile.am (revision 19140)
@@ -180,6 +180,9 @@
libinterfaces_la_SOURCES                += vxlan_xif.hh
libinterfaces_la_SOURCES                += vxlan_xif.cc

+libinterfaces_la_SOURCES                += ovsdb_xif.hh
+libinterfaces_la_SOURCES                += ovsdb_xif.cc
+
libinterfaces_la_SOURCES                += dot1x_xif.hh
libinterfaces_la_SOURCES                += dot1x_xif.cc

sam.gang@dev-20:~/pica8/branches/1.1$ svn diff -r18992:19140 ./pica/picaxrl/targets/Makefile.am     
Index: pica/picaxrl/targets/Makefile.am
===================================================================
--- pica/picaxrl/targets/Makefile.am    (revision 18992)
+++ pica/picaxrl/targets/Makefile.am    (revision 19140)
@@ -42,6 +42,7 @@
tgt_files              += sflow.tgt
tgt_files              += udld.tgt
tgt_files              += vxlan.tgt
+tgt_files              += nsx_integration.tgt     编译的时候加上这个,能多编译出nsx_integration_base.XX文件
tgt_files              += dot1x.tgt

# Automatically compute the list of the *.xrls files
@@ -192,7 +193,6 @@
         $(INTERFACES_DIR)/neighbour_config.xif                      \
         $(INTERFACES_DIR)/dhcp_snooping_event.xif                   \
         $(INTERFACES_DIR)/filter_config.xif                         \
-        $(INTERFACES_DIR)/vxlan.xif                                 \
         $(INTERFACES_DIR)/switch_buffer_config.xif                  \
         $(INTERFACES_DIR)/switch_vlan_event.xif                     \
         $(INTERFACES_DIR)/cos_config.xif                            \
@@ -349,6 +349,13 @@
         $(INTERFACES_DIR)/log.xif                      \
                $(srcdir)/vxlan.tgt

+# nsx_integration          以下是将上面的API编译进去
+libtargets_la_SOURCES += nsx_integration_base.hh nsx_integration_base.cc
+$(srcdir)/nsx_integration_base.hh $(srcdir)/nsx_integration_base.cc: \
+        $(INTERFACES_DIR)/common.xif                    \
+        $(INTERFACES_DIR)/ovsdb.xif                     \
+        $(INTERFACES_DIR)/log.xif                       \
+        $(srcdir)/nsx_integration.tgt


1.2. nsx_integration文件夹,基本几部分:
· 实现nsx_integration_base接口中的命令:xrl_nsx_target.XX
· 主要的工作类:nsxconfig.XX。各种活都是他在干。
· 实现ovsdb配置转换成tree的工作:nsxtree.XX
· 主函数用于启动:nsx_integration.cc

2.  2014-12-18 15:18:21 CST
Gavin He 2014-12-18 15:18:21 CST
Author: ghe
Date: 2014-12-18 15:17:56 +0800 (Thu, 18 Dec 2014)
New Revision: 19146

Added:
   branches/1.1/xorp-1.6/rtrmgr/configure/nsx_config.cc
   branches/1.1/xorp-1.6/rtrmgr/configure/nsx_config.hh
   branches/1.1/xorp-1.6/rtrmgr/configure/nsx_target.cc
   branches/1.1/xorp-1.6/rtrmgr/configure/nsx_target.hh
Modified:
   branches/1.1/xorp-1.6/rtrmgr/configure/Makefile.am
   branches/1.1/xorp-1.6/rtrmgr/configure/configure.cc
Log:
bug#3264, add config check for nsx integration     不清楚什么叫config check。不过看代码nsx_target.cc、nsx_config.cc中对函数的实现有些是UNUSED,只是为了防止编译器报错。有些却有实现,不清楚。在一次添加show命令的实现中,修改了xrl文件,需要在nsx_integration和这里做两次修改,而这里却什么也没有修改。 目前不清楚config check作用是什么???

3.  2014-12-18 16:37:52 CST
Modified:
   branches/1.1/pica/nsx_integration/Makefile.am
Log:
bug#3264, add ovs directory to INCLUDES     添加include的头文件
-INCLUDES =     -I$(top_srcdir)/../xorp/ -I$(top_srcdir)/include \
-                       -I@PICA_COMMON_PLATFORM_PATH@
+INCLUDES = -I$(top_srcdir)/../xorp/ -I$(top_srcdir)/include \
+           -I$(top_srcdir)/../ovs/openvswitch-2.0 \
+           -I@PICA_COMMON_PLATFORM_PATH@

4.  2014-12-22 12:01:48 CST
Added:
   branches/1.1/pica/nsx_integration/cli_client.cc     添加客户端
   branches/1.1/pica/nsx_integration/cli_client.hh
Modified:
   branches/1.1/pica/etc/templates/common/ovsdb.tp     其他无关修改
   branches/1.1/pica/include/pica_target_names.hh     其他无关修改
   branches/1.1/pica/nsx_integration/Makefile.am
   branches/1.1/pica/nsx_integration/nsx_integration.cc     ??
   branches/1.1/pica/nsx_integration/nsxconfig.cc     
   branches/1.1/pica/nsx_integration/nsxconfig.hh
   branches/1.1/pica/nsx_integration/xrl_nsx_target.cc
   branches/1.1/pica/nsx_integration/xrl_nsx_target.hh
   branches/1.1/pica/picaxrl/targets/nsx_integration.tgt     很重要,见下。这个文件用处还要在分析
   branches/1.1/xorp-1.6/rtrmgr/configure/nsx_target.cc
   branches/1.1/xorp-1.6/rtrmgr/configure/nsx_target.hh
Log:
bug#33264, add register client to rtrmgr

sam.gang@dev-20:~/pica8/branches/1.1$ svn diff -r19140:19200 ./pica/picaxrl/targets/nsx_integration.tgt
Index: pica/picaxrl/targets/nsx_integration.tgt
===================================================================
--- pica/picaxrl/targets/nsx_integration.tgt    (revision 19140)
+++ pica/picaxrl/targets/nsx_integration.tgt    (revision 19200)
@@ -2,9 +2,11 @@
#include "common.xif"
#include "ovsdb.xif"
#include "log.xif"
+#include "../../../xorp/xrl/interfaces/rtrmgr_client.xif"

target nsx_integration implements \
             common/0.1, \
             ovsdb/0.1,  \
+            rtrmgr_client/0.2, \
             log/0.1
添加了rtrmgr_client/0.2这些API接口,进而修改了xrl_nsx_target.XX和nsx_target.XX文件
这个rtrmgr_client/0.2这些接口是作为rtrmgr client必须实现的接口,而实现的文件在xrl_nsx_target.XX文件中。
xrl_nsx_target作为CLI这边的TP文件修改的API,就是进入CLI-》CO下面之后修改TP文件的动作。
所以在nsx integration实现中有三个rtrmgr client,一个是这里的标准client,一个是nsx_pica只发送delta的client,一个是run show那边的client。

5.  2014-12-23 15:45:33 CST
添加OVS的库,但是这一次好像不成功


################# ovs-vtep ###################
1. 是一个vtep emulator。其他的看代码。

























猜你喜欢

转载自blog.csdn.net/batmancn/article/details/51417612