def _create_prefix_notification(outgoing_msg, rpc_session):
 assert outgoing_msg
 path = outgoing_msg.path
 assert path
 vpn_nlri = path.nlri
 assert (path.source is not None)
 if (path.source != VRF_TABLE):
  params = [{ROUTE_DISTINGUISHER: outgoing_msg.route_dist, PREFIX: vpn_nlri.prefix, NEXT_HOP: path.nexthop, VPN_LABEL: path.label_list[0], VRF_RF: VrfConf.rf_2_vrf_rf(path.route_family)}]
  if (not path.is_withdraw):
   rpc_msg = rpc_session.create_notification(NOTIFICATION_ADD_REMOTE_PREFIX, params)
  else:
   rpc_msg = rpc_session.create_notification(NOTIFICATION_DELETE_REMOTE_PREFIX, params)
 else:
  params = [{ROUTE_DISTINGUISHER: outgoing_msg.route_dist, PREFIX: vpn_nlri.prefix, NEXT_HOP: path.nexthop, VRF_RF: VrfConf.rf_2_vrf_rf(path.route_family), ORIGIN_RD: path.origin_rd}]
  if (not path.is_withdraw):
   rpc_msg = rpc_session.create_notification(NOTIFICATION_ADD_LOCAL_PREFIX, params)
  else:
   rpc_msg = rpc_session.create_notification(NOTIFICATION_DELETE_LOCAL_PREFIX, params)
 return rpc_msg

def _create_prefix_notification ( outgoing_msg , rpc_session ) : assert outgoing_msg path = outgoing_msg . path assert path vpn_nlri = path . nlri assert ( path . source is not None ) if ( path . source != VRF_TABLE ) : params = [ { ROUTE_DISTINGUISHER : outgoing_msg . route_dist , PREFIX : vpn_nlri . prefix , NEXT_HOP : path . nexthop , VPN_LABEL : path . label_list [ 0 ] , VRF_RF : VrfConf . rf_2_vrf_rf ( path . route_family ) } ] if ( not path . is_withdraw ) : rpc_msg = rpc_session . create_notification ( NOTIFICATION_ADD_REMOTE_PREFIX , params ) else : rpc_msg = rpc_session . create_notification ( NOTIFICATION_DELETE_REMOTE_PREFIX , params ) else : params = [ { ROUTE_DISTINGUISHER : outgoing_msg . route_dist , PREFIX : vpn_nlri . prefix , NEXT_HOP : path . nexthop , VRF_RF : VrfConf . rf_2_vrf_rf ( path . route_family ) , ORIGIN_RD : path . origin_rd } ] if ( not path . is_withdraw ) : rpc_msg = rpc_session . create_notification ( NOTIFICATION_ADD_LOCAL_PREFIX , params ) else : rpc_msg = rpc_session . create_notification ( NOTIFICATION_DELETE_LOCAL_PREFIX , params ) return rpc_msg
constructs prefix notification with data from given outgoing message .