MCPcopy Create free account
hub / github.com/deepflowio/deepflow / AddWANIP

Method AddWANIP

server/controller/recorder/cache/tool/data_set.go:544–555  ·  view source on GitHub ↗
(item *metadbmodel.WANIP)

Source from the content-addressed store, hash-verified

542}
543
544func (t *DataSet) AddWANIP(item *metadbmodel.WANIP) {
545 t.wanIPLcuuidToVInterfaceID[item.Lcuuid] = item.VInterfaceID
546 t.wanIPLcuuidToIP[item.Lcuuid] = item.IP
547 if vifLcuuid, _ := t.GetVInterfaceLcuuidByID(item.VInterfaceID); vifLcuuid != "" {
548 deviceType, _ := t.GetDeviceTypeByVInterfaceLcuuid(vifLcuuid)
549 deviceID, _ := t.GetDeviceIDByVInterfaceLcuuid(vifLcuuid)
550 mac, _ := t.GetMacByVInterfaceLcuuid(vifLcuuid)
551 networkID, _ := t.GetNetworkIDByVInterfaceLcuuid(vifLcuuid)
552 t.setDeviceToIPNetworkMap(deviceType, deviceID, networkID, IPKey{IP: item.IP, Mac: mac, Lcuuid: item.Lcuuid})
553 }
554 t.GetLogFunc()(addToToolMap(ctrlrcommon.RESOURCE_TYPE_WAN_IP_EN, item.Lcuuid), t.metadata.LogPrefixes)
555}
556
557func (t *DataSet) DeleteWANIP(lcuuid string) {
558 if vifID, ok := t.GetVInterfaceIDByWANIPLcuuid(lcuuid); ok {

Callers 3

GetWANIPByLcuuidMethod · 0.95
AddWANIPsMethod · 0.45

Tested by

no test coverage detected