error: request for member ‘private_data‘ in something not a structure or union

一、问题

编译器报错

error: request for member 'private_data' in something not a structure or union
 filp.private_data = &hello;
 	 ^

翻译:
错误:请求非结构或联合中的成员“private_data”

二、解决方案

filp.private_data改为filp->private_data。

三、原理

“.”是指指向的是结构体或者对象
“->”指向的是结构体或者对象的指针
In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainExtUtils/h/extUtils/trafficEngine/tgfTrafficGenerator.h:31:0, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:30, from hi/marvell/hiEnhancedSflow.c:7: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainExtUtils/h/extUtils/trafficEngine/tgfTrafficEngine.h:100:45: error: conflicting types for 'CPSS_NET_RX_CPU_CODE_ENT' typedef enum { CPSS_NET_RX_CPU_CODE_ENT_E } CPSS_NET_RX_CPU_CODE_ENT; ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/pha/cpssDxChPha.h:42:0, from hi/marvell/hiEnhancedSflow.c:3: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/networkIf/cpssGenNetIfTypes.h:1373:3: note: previous declaration of 'CPSS_NET_RX_CPU_CODE_ENT' was here } CPSS_NET_RX_CPU_CODE_ENT; ^ In file included from hi/marvell/hiEnhancedSflow.c:7:0: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:727:8: error: unknown type name 'CPSS_DXCH_MIRROR_ON_DROP_STC' IN CPSS_DXCH_MIRROR_ON_DROP_STC *configPtr ^ /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:751:9: error: unknown type name 'CPSS_DXCH_MIRROR_ON_DROP_STC' OUT CPSS_DXCH_MIRROR_ON_DROP_STC *configPtr ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/bridge/cpssDxChBrgVlan.h:29:0, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/networkIf/cpssDxChNetIfTypes.h:29, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/port/cpssDxChPortStat.h:32, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/extMac/cpssExtMacDrv.h:65, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/cpssHwInit/cpssHwInit.h:28, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/pcl/cpssDxChPcl.h:23, from hi/marvell/hiEnhancedSflow.c:11: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/bridge/cpssGenBrgVlanTypes.h:132:3: error: conflicting types for 'CPSS_ETHER_MODE_ENT' } CPSS_ETHER_MODE_ENT; ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:30:0, from hi/marvell/hiEnhancedSflow.c:7: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainExtUtils/h/extUtils/trafficEngine/tgfTrafficGenerator.h:41:40: note: previous declaration of 'CPSS_ETHER_MODE_ENT' was here typedef enum { CPSS_ETHER_MODE_ENT_E } CPSS_ETHER_MODE_ENT; ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/extMac/cpssExtMacDrv.h:66:0, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/cpssHwInit/cpssHwInit.h:28, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/pcl/cpssDxChPcl.h:23, from hi/marvell/hiEnhancedSflow.c:11: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/cscd/cpssGenCscd.h:87:3: error: conflicting types for 'CPSS_CSCD_PORT_TYPE_ENT' } CPSS_CSCD_PORT_TYPE_ENT; ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:30:0, from hi/marvell/hiEnhancedSflow.c:7: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainExtUtils/h/extUtils/trafficEngine/tgfTrafficGenerator.h:39:44: note: previous declaration of 'CPSS_CSCD_PORT_TYPE_ENT' was here typedef enum { CPSS_CSCD_PORT_TYPE_ENT_E } CPSS_CSCD_PORT_TYPE_ENT; ^ hi/marvell/hiEnhancedSflow.c:110:2: error: unknown type name 'PRV_TGF_BRG_EGRESS_PORT_INFO_STC' PRV_TGF_BRG_EGRESS_PORT_INFO_STC egressInfo; ^ hi/marvell/hiEnhancedSflow.c:111:5: error: unknown type name 'PRV_TGF_BRG_EGRESS_PORT_INFO_STC' PRV_TGF_BRG_EGRESS_PORT_INFO_STC egressInfo2; ^ hi/marvell/hiEnhancedSflow.c:133:11: error: 'PRV_TGF_VLANID_CNS' undeclared here (not in a function) 0, 0, PRV_TGF_VLANID_CNS /* pri, cfi, VlanId */ ^ In file included from hi/marvell/hiEnhancedSflow.c:18:0: hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowEpcl1config': ../fep/application/common/applError.h:241:12: error: 'return' with a value, in function returning void [-Werror] return __rv;\ ^ hi/marvell/hiEnhancedSflow.c:252:5: note: in expansion of macro 'APPL_IF_ERR_RET' APPL_IF_ERR_RET(hiTpclRuleAdd(appId, ruleId, &match, &action, &attr)); ^ hi/marvell/hiEnhancedSflow.c:254:12: error: 'return' with a value, in function returning void [-Werror] return ERR_NO_ERROR; ^ In file included from hi/marvell/hiEnhancedSflow.c:18:0: hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowEpcl2config': ../fep/application/common/applError.h:241:12: error: 'return' with a value, in function returning void [-Werror] return __rv;\ ^ hi/marvell/hiEnhancedSflow.c:296:2: note: in expansion of macro 'APPL_IF_ERR_RET' APPL_IF_ERR_RET(hiTpclRuleAdd(appId, ruleId, &match, &action, &attr)); ^ hi/marvell/hiEnhancedSflow.c:298:12: error: 'return' with a value, in function returning void [-Werror] return ERR_NO_ERROR; ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowEpcl3config': hi/marvell/hiEnhancedSflow.c:320:44: error: expected expression before '=' token match.match[HI_TPCL_MAT_EGR_LOCAL_UP_E] = = TRUE; ^ hi/marvell/hiEnhancedSflow.c:330:55: error: 'PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV4_CNS' undeclared (first use in this function) PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV4_CNS : ^ hi/marvell/hiEnhancedSflow.c:330:55: note: each undeclared identifier is reported only once for each function it appears in hi/marvell/hiEnhancedSflow.c:331:55: error: 'PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV6_CNS' undeclared (first use in this function) PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV6_CNS ; ^ In file included from hi/marvell/hiEnhancedSflow.c:18:0: ../fep/application/common/applError.h:241:12: error: 'return' with a value, in function returning void [-Werror] return __rv;\ ^ hi/marvell/hiEnhancedSflow.c:343:2: note: in expansion of macro 'APPL_IF_ERR_RET' APPL_IF_ERR_RET(hiTpclRuleAdd(appId, ruleId, &match, &action, &attr)); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowPhaConfig': hi/marvell/hiEnhancedSflow.c:364:5: error: implicit declaration of function 'UTF_VERIFY_EQUAL0_STRING_MAC' [-Werror=implicit-function-declaration] UTF_VERIFY_EQUAL0_STRING_MAC(GT_OK, rc, "Failure in cpssDxChPhaFwImageIdGet"); ^ hi/marvell/hiEnhancedSflow.c:386:62: error: 'PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV6_CNS' undeclared (first use in this function) rc = cpssDxChPhaThreadIdEntrySet(ENHANCED_SFLOW_DEV_CNS, PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV6_CNS, &commonInfo, ^ hi/marvell/hiEnhancedSflow.c:392:62: error: 'PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_CNS' undeclared (first use in this function) rc = cpssDxChPhaThreadIdEntrySet(ENHANCED_SFLOW_DEV_CNS, PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_CNS, &commonInfo, ^ hi/marvell/hiEnhancedSflow.c: In function 'EnhancedSflowIngressMirrorConfig': hi/marvell/hiEnhancedSflow.c:424:5: error: implicit declaration of function 'UTF_VERIFY_EQUAL1_STRING_MAC' [-Werror=implicit-function-declaration] UTF_VERIFY_EQUAL1_STRING_MAC(GT_OK, rc, "prvTgfMirrorAnalyzerInterfaceGet: %d", ENHANCED_SFLOW_DEV_CNS); ^ hi/marvell/hiEnhancedSflow.c:435:7: error: implicit declaration of function 'prvTgfBrgEportToPhysicalPortTargetMappingTableGet' [-Werror=implicit-function-declaration] rc = prvTgfBrgEportToPhysicalPortTargetMappingTableGet(ENHANCED_SFLOW_DEV_CNS, DEFAULT_EPORT_CNS, ^ hi/marvell/hiEnhancedSflow.c:441:5: error: implicit declaration of function 'prvTgfBrgEportToPhysicalPortTargetMappingTableSet' [-Werror=implicit-function-declaration] prvTgfBrgEportToPhysicalPortTargetMappingTableSet(ENHANCED_SFLOW_DEV_CNS, DEFAULT_EPORT_CNS, &phyPortInfo); ^ hi/marvell/hiEnhancedSflow.c:448:7: error: too many arguments to function 'cpssDxChMirrorTxStatMirrorToAnalyzerIndexRatioSet' rc = cpssDxChMirrorTxStatMirrorToAnalyzerIndexRatioSet(ENHANCED_SFLOW_DEV_CNS, SFLOW_ANALYZER_CNS, GT_TRUE, egRate); ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/tunnel/cpssDxChTunnelTypes.h:32:0, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/cpssDxChTypes.h:30, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/bridge/cpssDxChBrgVlan.h:33, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/networkIf/cpssDxChNetIfTypes.h:29, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/port/cpssDxChPortStat.h:32, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/extMac/cpssExtMacDrv.h:65, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/cpssHwInit/cpssHwInit.h:28, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/pcl/cpssDxChPcl.h:23, from hi/marvell/hiEnhancedSflow.c:11: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/mirror/cpssDxChMirror.h:1116:11: note: declared here GT_STATUS cpssDxChMirrorTxStatMirrorToAnalyzerIndexRatioSet ^ hi/marvell/hiEnhancedSflow.c: In function 'EnhancedSflowMirrorConfig': hi/marvell/hiEnhancedSflow.c:463:5: error: unknown type name 'PRV_TGF_BRG_EGRESS_PORT_INFO_STC' PRV_TGF_BRG_EGRESS_PORT_INFO_STC egressInfo; ^ hi/marvell/hiEnhancedSflow.c:476:10: error: implicit declaration of function 'prvTgfBrgEportToPhysicalPortEgressPortInfoGet' [-Werror=implicit-function-declaration] rc = prvTgfBrgEportToPhysicalPortEgressPortInfoGet(ENHANCED_SFLOW_DEV_CNS, PASS2_EPORT_CNS, ^ hi/marvell/hiEnhancedSflow.c:481:15: error: request for member 'tunnelStart' in something not a structure or union egressInfo.tunnelStart = GT_TRUE; ^ hi/marvell/hiEnhancedSflow.c:482:15: error: request for member 'tunnelStartPtr' in something not a structure or union egressInfo.tunnelStartPtr = protocol == CPSS_IP_PROTOCOL_IPV4_E? TUNNEL_START_IPV4_CNS : TUNNEL_START_IPV6_CNS; ^ hi/marvell/hiEnhancedSflow.c:483:15: error: request for member 'tsPassengerPacketType' in something not a structure or union egressInfo.tsPassengerPacketType = PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E; ^ hi/marvell/hiEnhancedSflow.c:483:41: error: 'PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E' undeclared (first use in this function) egressInfo.tsPassengerPacketType = PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E; ^ hi/marvell/hiEnhancedSflow.c:484:10: error: implicit declaration of function 'prvTgfBrgEportToPhysicalPortEgressPortInfoSet' [-Werror=implicit-function-declaration] rc = prvTgfBrgEportToPhysicalPortEgressPortInfoSet(ENHANCED_SFLOW_DEV_CNS, PASS2_EPORT_CNS, &egressInfo); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowIpclConfig': hi/marvell/hiEnhancedSflow.c:506:45: error: 'PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E' undeclared (first use in this function) pclAction.redirect.data.outIf.tunnelType = PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E; ^ In file included from hi/marvell/hiEnhancedSflow.c:18:0: ../fep/application/common/applError.h:241:12: error: 'return' with a value, in function returning void [-Werror] return __rv;\ ^ hi/marvell/hiEnhancedSflow.c:515:2: note: in expansion of macro 'APPL_IF_ERR_RET' APPL_IF_ERR_RET(hiTpclRuleAdd(appId, ruleId, &match, &action, &attr)); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowLBConfig': hi/marvell/hiEnhancedSflow.c:540:5: error: implicit declaration of function 'cpssOsTimerWkAfter' [-Werror=implicit-function-declaration] cpssOsTimerWkAfter(10); ^ hi/marvell/hiEnhancedSflow.c: In function 'EnhancedSflowIpTsConfig': hi/marvell/hiEnhancedSflow.c:557:5: error: unknown type name 'PRV_TGF_TUNNEL_START_ENTRY_UNT' PRV_TGF_TUNNEL_START_ENTRY_UNT tunnelEntry; ^ hi/marvell/hiEnhancedSflow.c:562:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.tagEnable = GT_TRUE; ^ hi/marvell/hiEnhancedSflow.c:563:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.vlanId = VLANID_CNS; ^ hi/marvell/hiEnhancedSflow.c:564:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.ttl = 20; ^ hi/marvell/hiEnhancedSflow.c:565:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.ipHeaderProtocol = PRV_TGF_TUNNEL_START_IP_HEADER_PROTOCOL_UDP_E; ^ hi/marvell/hiEnhancedSflow.c:565:54: error: 'PRV_TGF_TUNNEL_START_IP_HEADER_PROTOCOL_UDP_E' undeclared (first use in this function) tunnelEntry.ipv4Cfg.ipHeaderProtocol = PRV_TGF_TUNNEL_START_IP_HEADER_PROTOCOL_UDP_E; ^ hi/marvell/hiEnhancedSflow.c:566:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.udpDstPort = SFLOW_V5_UDP_PORT_CNS; ^ hi/marvell/hiEnhancedSflow.c:567:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.udpSrcPort = SFLOW_V5_UDP_PORT_CNS; ^ hi/marvell/hiEnhancedSflow.c:568:27: error: request for member 'ipv4Cfg' in something not a structure or union memcpy(tunnelEntry.ipv4Cfg.macDa.arEther, MirroredPacketTunnelL2Part.daMac, sizeof(TGF_MAC_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:569:27: error: request for member 'ipv4Cfg' in something not a structure or union memcpy(tunnelEntry.ipv4Cfg.destIp.arIP, colIpAddr, sizeof(TGF_IPV4_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:570:27: error: request for member 'ipv4Cfg' in something not a structure or union memcpy(tunnelEntry.ipv4Cfg.srcIp.arIP, MirroredPacketTunnelIpv4Part.srcAddr, sizeof(TGF_IPV4_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:571:14: error: implicit declaration of function 'prvTgfTunnelStartEntrySet' [-Werror=implicit-function-declaration] rc = prvTgfTunnelStartEntrySet(TUNNEL_START_IPV4_CNS, CPSS_TUNNEL_GENERIC_IPV4_E, &tunnelEntry); ^ hi/marvell/hiEnhancedSflow.c:575:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.tagEnable = GT_TRUE; ^ hi/marvell/hiEnhancedSflow.c:576:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.vlanId = VLANID_CNS; ^ hi/marvell/hiEnhancedSflow.c:577:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.ttl = 20; ^ hi/marvell/hiEnhancedSflow.c:578:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.ipHeaderProtocol = PRV_TGF_TUNNEL_START_IP_HEADER_PROTOCOL_UDP_E; ^ hi/marvell/hiEnhancedSflow.c:579:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.udpDstPort = SFLOW_V5_UDP_PORT_CNS; ^ hi/marvell/hiEnhancedSflow.c:580:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.udpSrcPort = SFLOW_V5_UDP_PORT_CNS; ^ hi/marvell/hiEnhancedSflow.c:581:27: error: request for member 'ipv6Cfg' in something not a structure or union memcpy(tunnelEntry.ipv6Cfg.macDa.arEther, MirroredPacketTunnelL2Part.daMac, sizeof(TGF_MAC_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:582:27: error: request for member 'ipv6Cfg' in something not a structure or union memcpy(tunnelEntry.ipv6Cfg.destIp.arIP, colIpAddr, sizeof(TGF_IPV6_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:583:27: error: request for member 'ipv6Cfg' in something not a structure or union memcpy(tunnelEntry.ipv6Cfg.srcIp.arIP, MirroredPacketTunnelIpv6Part.srcAddr, sizeof(TGF_IPV6_ADDR)); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowBridgeConfig': hi/marvell/hiEnhancedSflow.c:592:2: error: unknown type name 'PRV_TGF_BRG_MAC_ENTRY_STC' PRV_TGF_BRG_MAC_ENTRY_STC prvTgfMacEntry; ^ hi/marvell/hiEnhancedSflow.c:595:10: error: implicit declaration of function 'prvTgfBrgDefVlanEntryWriteWithTaggingCmd' [-Werror=implicit-function-declaration] rc = prvTgfBrgDefVlanEntryWriteWithTaggingCmd(ENHANCED_SFLOW_VLANID_CNS, PRV_TGF_BRG_VLAN_PORT_TAG0_CMD_E); ^ hi/marvell/hiEnhancedSflow.c:597:5: error: implicit declaration of function 'prvTgfBrgVlanMemberRemove' [-Werror=implicit-function-declaration] prvTgfBrgVlanMemberRemove(ENHANCED_SFLOW_DEV_CNS, ENHANCED_SFLOW_VLANID_CNS, ANALYZER_PORT_CNS); ^ hi/marvell/hiEnhancedSflow.c:601:19: error: request for member 'key' in something not a structure or union prvTgfMacEntry.key.entryType = PRV_TGF_FDB_ENTRY_TYPE_MAC_ADDR_E; ^ hi/marvell/hiEnhancedSflow.c:601:51: error: 'PRV_TGF_FDB_ENTRY_TYPE_MAC_ADDR_E' undeclared (first use in this function) prvTgfMacEntry.key.entryType = PRV_TGF_FDB_ENTRY_TYPE_MAC_ADDR_E; ^ hi/marvell/hiEnhancedSflow.c:602:19: error: request for member 'key' in something not a structure or union prvTgfMacEntry.key.key.macVlan.vlanId = ENHANCED_SFLOW_VLANID_CNS; ^ hi/marvell/hiEnhancedSflow.c:603:19: error: request for member 'dstInterface' in something not a structure or union prvTgfMacEntry.dstInterface.type = CPSS_INTERFACE_PORT_E; ^ hi/marvell/hiEnhancedSflow.c:604:19: error: request for member 'dstInterface' in something not a structure or union prvTgfMacEntry.dstInterface.devPort.hwDevNum = ENHANCED_SFLOW_DEV_CNS; ^ hi/marvell/hiEnhancedSflow.c:605:19: error: request for member 'dstInterface' in something not a structure or union prvTgfMacEntry.dstInterface.devPort.portNum = TX_PORT_CNS; /*the sender*/ ^ hi/marvell/hiEnhancedSflow.c:606:19: error: request for member 'isStatic' in something not a structure or union prvTgfMacEntry.isStatic = GT_FALSE; ^ hi/marvell/hiEnhancedSflow.c:607:19: error: request for member 'daCommand' in something not a structure or union prvTgfMacEntry.daCommand = PRV_TGF_PACKET_CMD_FORWARD_E; ^ hi/marvell/hiEnhancedSflow.c:607:51: error: 'PRV_TGF_PACKET_CMD_FORWARD_E' undeclared (first use in this function) prvTgfMacEntry.daCommand = PRV_TGF_PACKET_CMD_FORWARD_E; ^ hi/marvell/hiEnhancedSflow.c:608:19: error: request for member 'saCommand' in something not a structure or union prvTgfMacEntry.saCommand = PRV_TGF_PACKET_CMD_FORWARD_E; ^ hi/marvell/hiEnhancedSflow.c:610:26: error: request for member 'key' in something not a structure or union memcpy(prvTgfMacEntry.key.key.macVlan.macAddr.arEther, OriginalPacketL2Part.daMac, sizeof(TGF_MAC_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:613:10: error: implicit declaration of function 'prvTgfBrgFdbMacEntrySet' [-Werror=implicit-function-declaration] rc = prvTgfBrgFdbMacEntrySet(&prvTgfMacEntry); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowTrafficSend': hi/marvell/hiEnhancedSflow.c:703:5: error: implicit declaration of function 'PRV_UTF_LOG0_MAC' [-Werror=implicit-function-declaration] PRV_UTF_LOG0_MAC("======= Send first packet =======\n"); ^ hi/marvell/hiEnhancedSflow.c:705:60: error: 'TX_PORT_IDX_CNS' undeclared (first use in this function) rc = prvTgfStartTransmitingEth(ENHANCED_SFLOW_DEV_CNS, TX_PORT_IDX_CNS); ^ hi/marvell/hiEnhancedSflow.c:722:5: error: implicit declaration of function 'prvTgfMirrorEgressEnhancedSflowValidatePacket' [-Werror=implicit-function-declaration] prvTgfMirrorEgressEnhancedSflowValidatePacket(packetBuf, protocol); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowValidatePacket': hi/marvell/hiEnhancedSflow.c:761:35: error: 'TX_PORT_IDX_CNS' undeclared (first use in this function) UTF_VERIFY_EQUAL0_STRING_MAC((TX_PORT_IDX_CNS & 0XFF), value, "source port mismatch"); ^ hi/marvell/hiEnhancedSflow.c:763:10: error: implicit declaration of function 'cpssDxChCfgHwDevNumGet' [-Werror=implicit-function-declaration] rc = cpssDxChCfgHwDevNumGet(ENHANCED_SFLOW_DEV_CNS, &localDevNum); ^ cc1: all warnings being treated as errors CMakeFiles/dmp.dir/build.make:1365: recipe for target 'CMakeFiles/dmp.dir/hi/marvell/hiEnhancedSflow.c.o' failed make[4]: *** [CMakeFiles/dmp.dir/hi/marvell/hiEnhancedSflow.c.o] Error 1 make[4]: *** Waiting for unfinished jobs.... CMakeFiles/Makefile2:78: recipe for target 'CMakeFiles/dmp.dir/all' failed make[3]: *** [CMakeFiles/dmp.dir/all] Error 2 Makefile:132: recipe for target 'all' failed make[2]: *** [all] Error 2 package/tplink/tplink-generic.mk:289: recipe for target '/project/fep_switch/tplink/buildroot/build/ac5x_pro/build/tplink/dmp-1.0/.stamp_built' failed make[1]: *** [/project/fep_switch/tplink/buildroot/build/ac5x_pro/build/tplink/dmp-1.0/.stamp_built] Error 2 Makefile:84: recipe for target '_all' failed make: *** [_all] Error 2 解决下这些报错
10-14
In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainExtUtils/h/extUtils/trafficEngine/tgfTrafficGenerator.h:31:0, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:30, from hi/marvell/hiEnhancedSflow.c:5: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainExtUtils/h/extUtils/trafficEngine/tgfTrafficEngine.h:100:45: error: conflicting types for 'CPSS_NET_RX_CPU_CODE_ENT' typedef enum { CPSS_NET_RX_CPU_CODE_ENT_E } CPSS_NET_RX_CPU_CODE_ENT; ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/pha/cpssDxChPha.h:42:0, from hi/marvell/hiEnhancedSflow.c:1: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/networkIf/cpssGenNetIfTypes.h:1373:3: note: previous declaration of 'CPSS_NET_RX_CPU_CODE_ENT' was here } CPSS_NET_RX_CPU_CODE_ENT; ^ In file included from hi/marvell/hiEnhancedSflow.c:5:0: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:727:8: error: unknown type name 'CPSS_DXCH_MIRROR_ON_DROP_STC' IN CPSS_DXCH_MIRROR_ON_DROP_STC *configPtr ^ /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:751:9: error: unknown type name 'CPSS_DXCH_MIRROR_ON_DROP_STC' OUT CPSS_DXCH_MIRROR_ON_DROP_STC *configPtr ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/bridge/cpssDxChBrgVlan.h:29:0, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/networkIf/cpssDxChNetIfTypes.h:29, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/port/cpssDxChPortStat.h:32, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/extMac/cpssExtMacDrv.h:65, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/cpssHwInit/cpssHwInit.h:28, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/pcl/cpssDxChPcl.h:23, from hi/marvell/hiEnhancedSflow.c:9: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/bridge/cpssGenBrgVlanTypes.h:132:3: error: conflicting types for 'CPSS_ETHER_MODE_ENT' } CPSS_ETHER_MODE_ENT; ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:30:0, from hi/marvell/hiEnhancedSflow.c:5: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainExtUtils/h/extUtils/trafficEngine/tgfTrafficGenerator.h:41:40: note: previous declaration of 'CPSS_ETHER_MODE_ENT' was here typedef enum { CPSS_ETHER_MODE_ENT_E } CPSS_ETHER_MODE_ENT; ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/extMac/cpssExtMacDrv.h:66:0, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/cpssHwInit/cpssHwInit.h:28, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/pcl/cpssDxChPcl.h:23, from hi/marvell/hiEnhancedSflow.c:9: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/cscd/cpssGenCscd.h:87:3: error: conflicting types for 'CPSS_CSCD_PORT_TYPE_ENT' } CPSS_CSCD_PORT_TYPE_ENT; ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainUT/utfTraffic/h/common/tgfMirror.h:30:0, from hi/marvell/hiEnhancedSflow.c:5: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainExtUtils/h/extUtils/trafficEngine/tgfTrafficGenerator.h:39:44: note: previous declaration of 'CPSS_CSCD_PORT_TYPE_ENT' was here typedef enum { CPSS_CSCD_PORT_TYPE_ENT_E } CPSS_CSCD_PORT_TYPE_ENT; ^ hi/marvell/hiEnhancedSflow.c:105:2: error: unknown type name 'PRV_TGF_BRG_EGRESS_PORT_INFO_STC' PRV_TGF_BRG_EGRESS_PORT_INFO_STC egressInfo; ^ hi/marvell/hiEnhancedSflow.c:106:5: error: unknown type name 'PRV_TGF_BRG_EGRESS_PORT_INFO_STC' PRV_TGF_BRG_EGRESS_PORT_INFO_STC egressInfo2; ^ hi/marvell/hiEnhancedSflow.c:128:11: error: 'PRV_TGF_VLANID_CNS' undeclared here (not in a function) 0, 0, PRV_TGF_VLANID_CNS /* pri, cfi, VlanId */ ^ In file included from hi/marvell/hiEnhancedSflow.c:13:0: hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowEpcl1config': ../fep/application/common/applError.h:241:12: error: 'return' with a value, in function returning void [-Werror] return __rv;\ ^ hi/marvell/hiEnhancedSflow.c:247:5: note: in expansion of macro 'APPL_IF_ERR_RET' APPL_IF_ERR_RET(hiTpclRuleAdd(appId, ruleId, &match, &action, &attr)); ^ hi/marvell/hiEnhancedSflow.c:249:12: error: 'return' with a value, in function returning void [-Werror] return ERR_NO_ERROR; ^ In file included from hi/marvell/hiEnhancedSflow.c:13:0: hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowEpcl2config': ../fep/application/common/applError.h:241:12: error: 'return' with a value, in function returning void [-Werror] return __rv;\ ^ hi/marvell/hiEnhancedSflow.c:291:2: note: in expansion of macro 'APPL_IF_ERR_RET' APPL_IF_ERR_RET(hiTpclRuleAdd(appId, ruleId, &match, &action, &attr)); ^ hi/marvell/hiEnhancedSflow.c:293:12: error: 'return' with a value, in function returning void [-Werror] return ERR_NO_ERROR; ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowEpcl3config': hi/marvell/hiEnhancedSflow.c:315:44: error: expected expression before '=' token match.match[HI_TPCL_MAT_EGR_LOCAL_UP_E] = = TRUE; ^ hi/marvell/hiEnhancedSflow.c:325:55: error: 'PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV4_CNS' undeclared (first use in this function) PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV4_CNS : ^ hi/marvell/hiEnhancedSflow.c:325:55: note: each undeclared identifier is reported only once for each function it appears in hi/marvell/hiEnhancedSflow.c:326:55: error: 'PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV6_CNS' undeclared (first use in this function) PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV6_CNS ; ^ In file included from hi/marvell/hiEnhancedSflow.c:13:0: ../fep/application/common/applError.h:241:12: error: 'return' with a value, in function returning void [-Werror] return __rv;\ ^ hi/marvell/hiEnhancedSflow.c:338:2: note: in expansion of macro 'APPL_IF_ERR_RET' APPL_IF_ERR_RET(hiTpclRuleAdd(appId, ruleId, &match, &action, &attr)); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowPhaConfig': hi/marvell/hiEnhancedSflow.c:359:5: error: implicit declaration of function 'UTF_VERIFY_EQUAL0_STRING_MAC' [-Werror=implicit-function-declaration] UTF_VERIFY_EQUAL0_STRING_MAC(GT_OK, rc, "Failure in cpssDxChPhaFwImageIdGet"); ^ hi/marvell/hiEnhancedSflow.c:381:62: error: 'PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV6_CNS' undeclared (first use in this function) rc = cpssDxChPhaThreadIdEntrySet(ENHANCED_SFLOW_DEV_CNS, PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_IPV6_CNS, &commonInfo, ^ hi/marvell/hiEnhancedSflow.c:387:62: error: 'PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_CNS' undeclared (first use in this function) rc = cpssDxChPhaThreadIdEntrySet(ENHANCED_SFLOW_DEV_CNS, PRV_TGF_PHA_THREAD_ID_ENHANCED_SFLOW_CNS, &commonInfo, ^ hi/marvell/hiEnhancedSflow.c: In function 'EnhancedSflowIngressMirrorConfig': hi/marvell/hiEnhancedSflow.c:419:5: error: implicit declaration of function 'UTF_VERIFY_EQUAL1_STRING_MAC' [-Werror=implicit-function-declaration] UTF_VERIFY_EQUAL1_STRING_MAC(GT_OK, rc, "prvTgfMirrorAnalyzerInterfaceGet: %d", ENHANCED_SFLOW_DEV_CNS); ^ hi/marvell/hiEnhancedSflow.c:430:7: error: implicit declaration of function 'prvTgfBrgEportToPhysicalPortTargetMappingTableGet' [-Werror=implicit-function-declaration] rc = prvTgfBrgEportToPhysicalPortTargetMappingTableGet(ENHANCED_SFLOW_DEV_CNS, DEFAULT_EPORT_CNS, ^ hi/marvell/hiEnhancedSflow.c:436:5: error: implicit declaration of function 'prvTgfBrgEportToPhysicalPortTargetMappingTableSet' [-Werror=implicit-function-declaration] prvTgfBrgEportToPhysicalPortTargetMappingTableSet(ENHANCED_SFLOW_DEV_CNS, DEFAULT_EPORT_CNS, &phyPortInfo); ^ hi/marvell/hiEnhancedSflow.c:443:7: error: too many arguments to function 'cpssDxChMirrorTxStatMirrorToAnalyzerIndexRatioSet' rc = cpssDxChMirrorTxStatMirrorToAnalyzerIndexRatioSet(ENHANCED_SFLOW_DEV_CNS, SFLOW_ANALYZER_CNS, GT_TRUE, egRate); ^ In file included from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/tunnel/cpssDxChTunnelTypes.h:32:0, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/cpssDxChTypes.h:30, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/bridge/cpssDxChBrgVlan.h:33, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/networkIf/cpssDxChNetIfTypes.h:29, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/port/cpssDxChPortStat.h:32, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/extMac/cpssExtMacDrv.h:65, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/generic/cpssHwInit/cpssHwInit.h:28, from /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/pcl/cpssDxChPcl.h:23, from hi/marvell/hiEnhancedSflow.c:9: /project/fep_switch/tplink/buildroot/../../ldk_marvell/cpss_work_4.3.18//cpss/mainPpDrv/h/cpss/dxCh/dxChxGen/mirror/cpssDxChMirror.h:1116:11: note: declared here GT_STATUS cpssDxChMirrorTxStatMirrorToAnalyzerIndexRatioSet ^ hi/marvell/hiEnhancedSflow.c: In function 'EnhancedSflowMirrorConfig': hi/marvell/hiEnhancedSflow.c:458:5: error: unknown type name 'PRV_TGF_BRG_EGRESS_PORT_INFO_STC' PRV_TGF_BRG_EGRESS_PORT_INFO_STC egressInfo; ^ hi/marvell/hiEnhancedSflow.c:471:10: error: implicit declaration of function 'prvTgfBrgEportToPhysicalPortEgressPortInfoGet' [-Werror=implicit-function-declaration] rc = prvTgfBrgEportToPhysicalPortEgressPortInfoGet(ENHANCED_SFLOW_DEV_CNS, PASS2_EPORT_CNS, ^ hi/marvell/hiEnhancedSflow.c:476:15: error: request for member 'tunnelStart' in something not a structure or union egressInfo.tunnelStart = GT_TRUE; ^ hi/marvell/hiEnhancedSflow.c:477:15: error: request for member 'tunnelStartPtr' in something not a structure or union egressInfo.tunnelStartPtr = protocol == CPSS_IP_PROTOCOL_IPV4_E? TUNNEL_START_IPV4_CNS : TUNNEL_START_IPV6_CNS; ^ hi/marvell/hiEnhancedSflow.c:478:15: error: request for member 'tsPassengerPacketType' in something not a structure or union egressInfo.tsPassengerPacketType = PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E; ^ hi/marvell/hiEnhancedSflow.c:478:41: error: 'PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E' undeclared (first use in this function) egressInfo.tsPassengerPacketType = PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E; ^ hi/marvell/hiEnhancedSflow.c:479:10: error: implicit declaration of function 'prvTgfBrgEportToPhysicalPortEgressPortInfoSet' [-Werror=implicit-function-declaration] rc = prvTgfBrgEportToPhysicalPortEgressPortInfoSet(ENHANCED_SFLOW_DEV_CNS, PASS2_EPORT_CNS, &egressInfo); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowIpclConfig': hi/marvell/hiEnhancedSflow.c:501:45: error: 'PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E' undeclared (first use in this function) pclAction.redirect.data.outIf.tunnelType = PRV_TGF_TUNNEL_PASSENGER_ETHERNET_E; ^ In file included from hi/marvell/hiEnhancedSflow.c:13:0: ../fep/application/common/applError.h:241:12: error: 'return' with a value, in function returning void [-Werror] return __rv;\ ^ hi/marvell/hiEnhancedSflow.c:510:2: note: in expansion of macro 'APPL_IF_ERR_RET' APPL_IF_ERR_RET(hiTpclRuleAdd(appId, ruleId, &match, &action, &attr)); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowLBConfig': hi/marvell/hiEnhancedSflow.c:535:5: error: implicit declaration of function 'cpssOsTimerWkAfter' [-Werror=implicit-function-declaration] cpssOsTimerWkAfter(10); ^ hi/marvell/hiEnhancedSflow.c: In function 'EnhancedSflowIpTsConfig': hi/marvell/hiEnhancedSflow.c:552:5: error: unknown type name 'PRV_TGF_TUNNEL_START_ENTRY_UNT' PRV_TGF_TUNNEL_START_ENTRY_UNT tunnelEntry; ^ hi/marvell/hiEnhancedSflow.c:557:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.tagEnable = GT_TRUE; ^ hi/marvell/hiEnhancedSflow.c:558:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.vlanId = VLANID_CNS; ^ hi/marvell/hiEnhancedSflow.c:559:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.ttl = 20; ^ hi/marvell/hiEnhancedSflow.c:560:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.ipHeaderProtocol = PRV_TGF_TUNNEL_START_IP_HEADER_PROTOCOL_UDP_E; ^ hi/marvell/hiEnhancedSflow.c:560:54: error: 'PRV_TGF_TUNNEL_START_IP_HEADER_PROTOCOL_UDP_E' undeclared (first use in this function) tunnelEntry.ipv4Cfg.ipHeaderProtocol = PRV_TGF_TUNNEL_START_IP_HEADER_PROTOCOL_UDP_E; ^ hi/marvell/hiEnhancedSflow.c:561:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.udpDstPort = SFLOW_V5_UDP_PORT_CNS; ^ hi/marvell/hiEnhancedSflow.c:562:20: error: request for member 'ipv4Cfg' in something not a structure or union tunnelEntry.ipv4Cfg.udpSrcPort = SFLOW_V5_UDP_PORT_CNS; ^ hi/marvell/hiEnhancedSflow.c:563:27: error: request for member 'ipv4Cfg' in something not a structure or union memcpy(tunnelEntry.ipv4Cfg.macDa.arEther, MirroredPacketTunnelL2Part.daMac, sizeof(TGF_MAC_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:564:27: error: request for member 'ipv4Cfg' in something not a structure or union memcpy(tunnelEntry.ipv4Cfg.destIp.arIP, colIpAddr, sizeof(TGF_IPV4_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:565:27: error: request for member 'ipv4Cfg' in something not a structure or union memcpy(tunnelEntry.ipv4Cfg.srcIp.arIP, MirroredPacketTunnelIpv4Part.srcAddr, sizeof(TGF_IPV4_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:566:14: error: implicit declaration of function 'prvTgfTunnelStartEntrySet' [-Werror=implicit-function-declaration] rc = prvTgfTunnelStartEntrySet(TUNNEL_START_IPV4_CNS, CPSS_TUNNEL_GENERIC_IPV4_E, &tunnelEntry); ^ hi/marvell/hiEnhancedSflow.c:570:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.tagEnable = GT_TRUE; ^ hi/marvell/hiEnhancedSflow.c:571:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.vlanId = VLANID_CNS; ^ hi/marvell/hiEnhancedSflow.c:572:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.ttl = 20; ^ hi/marvell/hiEnhancedSflow.c:573:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.ipHeaderProtocol = PRV_TGF_TUNNEL_START_IP_HEADER_PROTOCOL_UDP_E; ^ hi/marvell/hiEnhancedSflow.c:574:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.udpDstPort = SFLOW_V5_UDP_PORT_CNS; ^ hi/marvell/hiEnhancedSflow.c:575:20: error: request for member 'ipv6Cfg' in something not a structure or union tunnelEntry.ipv6Cfg.udpSrcPort = SFLOW_V5_UDP_PORT_CNS; ^ hi/marvell/hiEnhancedSflow.c:576:27: error: request for member 'ipv6Cfg' in something not a structure or union memcpy(tunnelEntry.ipv6Cfg.macDa.arEther, MirroredPacketTunnelL2Part.daMac, sizeof(TGF_MAC_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:577:27: error: request for member 'ipv6Cfg' in something not a structure or union memcpy(tunnelEntry.ipv6Cfg.destIp.arIP, colIpAddr, sizeof(TGF_IPV6_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:578:27: error: request for member 'ipv6Cfg' in something not a structure or union memcpy(tunnelEntry.ipv6Cfg.srcIp.arIP, MirroredPacketTunnelIpv6Part.srcAddr, sizeof(TGF_IPV6_ADDR)); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowBridgeConfig': hi/marvell/hiEnhancedSflow.c:587:2: error: unknown type name 'PRV_TGF_BRG_MAC_ENTRY_STC' PRV_TGF_BRG_MAC_ENTRY_STC prvTgfMacEntry; ^ hi/marvell/hiEnhancedSflow.c:590:10: error: implicit declaration of function 'prvTgfBrgDefVlanEntryWriteWithTaggingCmd' [-Werror=implicit-function-declaration] rc = prvTgfBrgDefVlanEntryWriteWithTaggingCmd(ENHANCED_SFLOW_VLANID_CNS, PRV_TGF_BRG_VLAN_PORT_TAG0_CMD_E); ^ hi/marvell/hiEnhancedSflow.c:592:5: error: implicit declaration of function 'prvTgfBrgVlanMemberRemove' [-Werror=implicit-function-declaration] prvTgfBrgVlanMemberRemove(ENHANCED_SFLOW_DEV_CNS, ENHANCED_SFLOW_VLANID_CNS, ANALYZER_PORT_CNS); ^ hi/marvell/hiEnhancedSflow.c:596:19: error: request for member 'key' in something not a structure or union prvTgfMacEntry.key.entryType = PRV_TGF_FDB_ENTRY_TYPE_MAC_ADDR_E; ^ hi/marvell/hiEnhancedSflow.c:596:51: error: 'PRV_TGF_FDB_ENTRY_TYPE_MAC_ADDR_E' undeclared (first use in this function) prvTgfMacEntry.key.entryType = PRV_TGF_FDB_ENTRY_TYPE_MAC_ADDR_E; ^ hi/marvell/hiEnhancedSflow.c:597:19: error: request for member 'key' in something not a structure or union prvTgfMacEntry.key.key.macVlan.vlanId = ENHANCED_SFLOW_VLANID_CNS; ^ hi/marvell/hiEnhancedSflow.c:598:19: error: request for member 'dstInterface' in something not a structure or union prvTgfMacEntry.dstInterface.type = CPSS_INTERFACE_PORT_E; ^ hi/marvell/hiEnhancedSflow.c:599:19: error: request for member 'dstInterface' in something not a structure or union prvTgfMacEntry.dstInterface.devPort.hwDevNum = ENHANCED_SFLOW_DEV_CNS; ^ hi/marvell/hiEnhancedSflow.c:600:19: error: request for member 'dstInterface' in something not a structure or union prvTgfMacEntry.dstInterface.devPort.portNum = TX_PORT_CNS; /*the sender*/ ^ hi/marvell/hiEnhancedSflow.c:601:19: error: request for member 'isStatic' in something not a structure or union prvTgfMacEntry.isStatic = GT_FALSE; ^ hi/marvell/hiEnhancedSflow.c:602:19: error: request for member 'daCommand' in something not a structure or union prvTgfMacEntry.daCommand = PRV_TGF_PACKET_CMD_FORWARD_E; ^ hi/marvell/hiEnhancedSflow.c:602:51: error: 'PRV_TGF_PACKET_CMD_FORWARD_E' undeclared (first use in this function) prvTgfMacEntry.daCommand = PRV_TGF_PACKET_CMD_FORWARD_E; ^ hi/marvell/hiEnhancedSflow.c:603:19: error: request for member 'saCommand' in something not a structure or union prvTgfMacEntry.saCommand = PRV_TGF_PACKET_CMD_FORWARD_E; ^ hi/marvell/hiEnhancedSflow.c:605:26: error: request for member 'key' in something not a structure or union memcpy(prvTgfMacEntry.key.key.macVlan.macAddr.arEther, OriginalPacketL2Part.daMac, sizeof(TGF_MAC_ADDR)); ^ hi/marvell/hiEnhancedSflow.c:608:10: error: implicit declaration of function 'prvTgfBrgFdbMacEntrySet' [-Werror=implicit-function-declaration] rc = prvTgfBrgFdbMacEntrySet(&prvTgfMacEntry); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowTrafficSend': hi/marvell/hiEnhancedSflow.c:698:5: error: implicit declaration of function 'PRV_UTF_LOG0_MAC' [-Werror=implicit-function-declaration] PRV_UTF_LOG0_MAC("======= Send first packet =======\n"); ^ hi/marvell/hiEnhancedSflow.c:700:60: error: 'TX_PORT_IDX_CNS' undeclared (first use in this function) rc = prvTgfStartTransmitingEth(ENHANCED_SFLOW_DEV_CNS, TX_PORT_IDX_CNS); ^ hi/marvell/hiEnhancedSflow.c:714:5: error: implicit declaration of function 'tgfTrafficTableRxPcktTblClear' [-Werror=implicit-function-declaration] tgfTrafficTableRxPcktTblClear(); ^ hi/marvell/hiEnhancedSflow.c:717:5: error: implicit declaration of function 'prvTgfMirrorEgressEnhancedSflowValidatePacket' [-Werror=implicit-function-declaration] prvTgfMirrorEgressEnhancedSflowValidatePacket(packetBuf, protocol); ^ hi/marvell/hiEnhancedSflow.c: In function 'MirrorEgressEnhancedSflowValidatePacket': hi/marvell/hiEnhancedSflow.c:756:35: error: 'TX_PORT_IDX_CNS' undeclared (first use in this function) UTF_VERIFY_EQUAL0_STRING_MAC((TX_PORT_IDX_CNS & 0XFF), value, "source port mismatch"); ^ hi/marvell/hiEnhancedSflow.c:758:10: error: implicit declaration of function 'cpssDxChCfgHwDevNumGet' [-Werror=implicit-function-declaration] rc = cpssDxChCfgHwDevNumGet(ENHANCED_SFLOW_DEV_CNS, &localDevNum); 以上是报错信息,下面是我代码包含的头文件,请给出具体的解决方案 #include <cpss/dxCh/dxChxGen/pha/cpssDxChPha.h> #include <cpss/common/cpssTypes.h> #include <common/tgfBridgeGen.h> #include <common/tgfMirror.h> #include <common/tgfTunnelGen.h> #include <common/tgfCommon.h> #include <cpss/dxCh/dxChxGen/pcl/cpssDxChPcl.h> #include <cpss/dxCh/dxChxGen/pha/cpssDxChPha.h> #include <cpss/dxCh/dxChxGen/mirror/cpssDxChMirror.h> #include "common/applError.h" #include "tpDbg/tpdebug.h" #include "hi/hiTpcl.h" #include "hi/hiEnhancedSflow.h"
10-14
/include/libubox -c -o traffic.o traffic.c traffic.c:32:54: error: unknown type name 'UbusResponse' static int parse_json_response(const char *json_str, UbusResponse *resp) { ^~~~~~~~~~~~ traffic.c: In function 'fetch_tfstats_data': traffic.c:96:5: error: unknown type name 'UbusResponse' UbusResponse response = {0}; // 初始化响应结构 ^~~~~~~~~~~~ traffic.c:105:9: warning: implicit declaration of function 'parse_json_response'; did you mean 'parse_app_record'? [-Wimplicit-function-declaration] if (parse_json_response(json_output, &response) != 0) { ^~~~~~~~~~~~~~~~~~~ parse_app_record traffic.c:113:29: error: request for member 'count' in something not a structure or union *client_count = response.count; ^ traffic.c:114:20: error: request for member 'clients' in something not a structure or union return response.clients; ^ Makefile:13: recipe for target 'traffic.o' failed make[4]: *** [traffic.o] Error 1 make[4]: Leaving directory '/ge550v2/Iplatform/openwrt/build_dir/target-aarch64-openwrt-linux-uclibc-ge550v2/anti_jitter-1.0' Makefile:58: recipe for target '/ge550v2/Iplatform/openwrt/build_dir/target-aarch64-openwrt-linux-uclibc-ge550v2/anti_jitter-1.0/.built' failed make[3]: *** [/ge550v2/Iplatform/openwrt/build_dir/target-aarch64-openwrt-linux-uclibc-ge550v2/anti_jitter-1.0/.built] Error 2 make[3]: Leaving directory '/ge550v2/Iplatform/packages/private/anti_jitter' package/Makefile:133: recipe for target 'package/feeds/iplatform/anti_jitter/compile' failed make[2]: *** [package/feeds/iplatform/anti_jitter/compile] Error 2 make[2]: Leaving directory '/ge550v2/Iplatform/openwrt' /ge550v2/Iplatform/openwrt/include/toplevel.mk:184: recipe for target 'package/anti_jitter/compile' failed make[1]: *** [package/anti_jitter/compile] Error 2 make[1]: Leaving directory '/ge550v2/Iplatform/openwrt' Makefile:232: recipe for target 'iplatform_package/anti_jitter/compile' failed make: *** [iplatform_package/anti_jitter/compile] Error 2 huaxi@69b592cc434c:/ge550v2/Iplatform/build$
最新发布
10-24
编译的时候报错了,该怎么修改代码解决? PATH=“/mydisk/platform/buildroot/build/armv8/host/bin:/mydisk/platform/buildroot/build/armv8/host/sbin:/usr/local/bin:/home/felix/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin” /usr/bin/make -j4 -C /mydisk/platform/buildroot/build/armv8/build/tplink/gpioReset-1.0/ Scanning dependencies of target gpioReset [ 33%] Building C object CMakeFiles/gpioReset.dir/srvcGpioReset.c.o [ 66%] Building C object CMakeFiles/gpioReset.dir/mainGpioReset.c.o srvcGpioReset.c: In function ‘gpioResetSrvc’: srvcGpioReset.c:22:16: error: ‘ERR_INIT’ undeclared (first use in this function); did you mean ‘ESRMNT’? return ERR_INIT; ^~~~~~~~ ESRMNT srvcGpioReset.c:22:16: note: each undeclared identifier is reported only once for each function it appears in srvcGpioReset.c:80:12: error: ‘ERR_NO_ERROR’ undeclared (first use in this function); did you mean ‘PAL_MQ_ERROR’? return ERR_NO_ERROR; ^~~~~~~~~~~~ PAL_MQ_ERROR srvcGpioReset.c: In function ‘gpioResetSrvcExit’: srvcGpioReset.c:86:12: error: ‘ERR_NO_ERROR’ undeclared (first use in this function); did you mean ‘PAL_MQ_ERROR’? return ERR_NO_ERROR; ^~~~~~~~~~~~ PAL_MQ_ERROR srvcGpioReset.c:87:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: all warnings being treated as errors CMakeFiles/gpioReset.dir/build.make:78: recipe for target ‘CMakeFiles/gpioReset.dir/srvcGpioReset.c.o’ failed make[4]: *** [CMakeFiles/gpioReset.dir/srvcGpioReset.c.o] Error 1 make[4]: *** Waiting for unfinished jobs… mainGpioReset.c: In function ‘init_gpio_reset’: mainGpioReset.c:89:5: error: unknown type name ‘shell_init_func_t’ shell_init_func_t shell_initfunc = {}; ^~~~~~~~~~~~~~~~~ mainGpioReset.c:89:40: error: empty scalar initializer shell_init_func_t shell_initfunc = {}; ^ mainGpioReset.c:89:40: note: (near initialization for ‘shell_initfunc’) mainGpioReset.c:90:28: error: request for member ‘mm_init_table’ in something not a structure or union memcpy(&(shell_initfunc.mm_init_table), &initFunc, sizeof(mm_app_init_t)); ^ mainGpioReset.c:91:5: error: implicit declaration of function ‘shell_regfunc’ [-Werror=implicit-function-declaration] shell_regfunc(MODULE_GPIO_RESET_INDEX, shell_initfunc, srvc, mm_app_srvc_size(srvc), GPIO_RESET_SUB_NAME); ^~~~~~~~~~~~~ mainGpioReset.c:91:19: error: ‘MODULE_GPIO_RESET_INDEX’ undeclared (first use in this function); did you mean ‘SRVC_GPIO_RESET_H’? shell_regfunc(MODULE_GPIO_RESET_INDEX, shell_initfunc, srvc, mm_app_srvc_size(srvc), GPIO_RESET_SUB_NAME); ^~~~~~~~~~~~~~~~~~~~~~~ SRVC_GPIO_RESET_H mainGpioReset.c:91:19: note: each undeclared identifier is reported only once for each function it appears in cc1: all warnings being treated as errors CMakeFiles/gpioReset.dir/build.make:65: recipe for target ‘CMakeFiles/gpioReset.dir/mainGpioReset.c.o’ failed make[4]: *** [CMakeFiles/gpioReset.dir/mainGpioReset.c.o] Error 1 CMakeFiles/Makefile2:78: recipe for target ‘CMakeFiles/gpioReset.dir/all’ failed make[3]: *** [CMakeFiles/gpioReset.dir/all] Error 2 Makefile:132: recipe for target ‘all’ failed make[2]: *** [all] Error 2 package/tplink/tplink-generic.mk:289: recipe for target ‘/mydisk/platform/buildroot/build/armv8/build/tplink/gpioReset-1.0/.stamp_built’ failed make[1]: *** [/mydisk/platform/buildroot/build/armv8/build/tplink/gpioReset-1.0/.stamp_built] Error 2 Makefile:84: recipe for target ‘_all’ failed make: *** [_all] Error 2 下面是现在的代码: main: /*!Copyright (c) 2010-2011 TP-LINK Technologies CO.,LTD. *All rights reserved. * *\file mainRebootScheduleCpn.c *\brief * *\author Yang Jingjing *\version *\date 2025-09-09 */ /**************************************************************************************************/ /* INCLUDE_FILES */ /**************************************************************************************************/ /* libc header */ #include <stdio.h> #include <unistd.h> #include "fepDefs.h" #include "pal/msgq.h" #include "tpDbg/tpdebug.h" #include "mm/mm.h" #include "common/applError.h" #include "srvcGpioReset.h" /**************************************************************************************************/ /* DEFINES */ /**************************************************************************************************/ #define GPIO_RESET_USR_NAME_MAX_LEN 10 #define GPIO_RESET_SUB_NAME "GPIO_RESET" /**************************************************************************************************/ /* TYPES */ /**************************************************************************************************/ /**************************************************************************************************/ /* EXTERN_PROTOTYPES */ /**************************************************************************************************/ /**************************************************************************************************/ /* LOCAL_PROTOTYPES */ /**************************************************************************************************/ /**************************************************************************************************/ /* VARIABLES */ /**************************************************************************************************/ static mm_app_prvt_srvc_t srvc[] = { { .tid = PAL_THREAD_ERROR, .func = gpioResetSrvc, .pre_exit_f = gpioResetSrvcExit, .name = "gpio-reset", .start = MM_APP_SRVC_IDLE, .stack_size = SRVC_GPIO_RESET_STACK_SIZE_DEFAULT, .prio = SRVC_GPIO_RESET_PRIO_DEFAULT, .srvc_id = GPIO_RESET_PRVT_SRVC, .meta_arg = NULL } }; /**************************************************************************************************/ /* LOCAL_FUNCTIONS */ /**************************************************************************************************/ /**************************************************************************************************/ /* PUBLIC_FUNCTIONS */ /**************************************************************************************************/ static __attribute__((constructor)) int init_gpio_reset() { mm_app_init_t initFunc = {0}; DBG("GPIO Reset main start."); // 初始化函数表(保留基本结构,简化不必要的初始化) initFunc._init_platform = NULL; initFunc._init_private = NULL; initFunc._init_public = NULL; initFunc._init_application = NULL; initFunc._init_preconfig = NULL; initFunc._init_defconfig = NULL; initFunc._init_loadconfig = NULL; initFunc._init_stable = NULL; shell_init_func_t shell_initfunc = {}; memcpy(&(shell_initfunc.mm_init_table), &initFunc, sizeof(mm_app_init_t)); shell_regfunc(MODULE_GPIO_RESET_INDEX, shell_initfunc, srvc, mm_app_srvc_size(srvc), GPIO_RESET_SUB_NAME); DBG("GPIO Reset main loop."); return 0; } srvc: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <linux/netlink.h> #include "srvcGpioReset.h" #include "tpDbg/tpdebug.h" int gpioResetSrvc(void *param) { struct sockaddr_nl src_addr, dest_addr; struct nlmsghdr *nlh = NULL; struct iovec iov; struct msghdr msg; int sock_fd, ret; // 创建Netlink socket sock_fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GPIO_EVENT); if (sock_fd < 0) { DBG_ERR("Failed to create netlink socket: %s", strerror(errno)); return ERR_INIT; } memset(&src_addr, 0, sizeof(src_addr)); src_addr.nl_family = AF_NETLINK; src_addr.nl_pid = getpid(); // 应用进程ID src_addr.nl_groups = 1; // 加入组播组1 // 绑定socket if (bind(sock_fd, (struct sockaddr*)&src_addr, sizeof(src_addr))) { DBG_ERR("Bind failed: %s", strerror(errno)); close(sock_fd); return ERR_INIT; } // 准备接收缓冲区 nlh = (struct nlmsghdr *)malloc(NLMSG_SPACE(sizeof(struct gpio_netlink_msg))); if (!nlh) { DBG_ERR("Memory allocation failed"); close(sock_fd); return ERR_INIT; } memset(nlh, 0, NLMSG_SPACE(sizeof(struct gpio_netlink_msg))); iov.iov_base = (void *)nlh; iov.iov_len = NLMSG_SPACE(sizeof(struct gpio_netlink_msg)); memset(&msg, 0, sizeof(msg)); msg.msg_name = (void *)&dest_addr; msg.msg_namelen = sizeof(dest_addr); msg.msg_iov = &iov; msg.msg_iovlen = 1; DBG("GPIO Reset service started. Waiting for reset events..."); while (1) { // 接收Netlink消息 ret = recvmsg(sock_fd, &msg, 0); if (ret < 0) { DBG_ERR("recvmsg error: %s", strerror(errno)); continue; } // 解析消息 struct gpio_netlink_msg *msg_data = (struct gpio_netlink_msg *)NLMSG_DATA(nlh); // 检查是否为reset事件 if (strcmp(msg_data->button_name, "reset") == 0) { DBG("=== RESET EVENT DETECTED ==="); DBG("Event type: %u", msg_data->event_type); DBG("Value: %d", msg_data->value); DBG("Timestamp: %lu", msg_data->timestamp); DBG("============================"); } } free(nlh); close(sock_fd); return ERR_NO_ERROR; } int gpioResetSrvcExit(void *param) { // 清理资源的位置(实际在循环中不会退出) return ERR_NO_ERROR; } srvc.h: #ifndef _SRVC_GPIO_RESET_H_ #define _SRVC_GPIO_RESET_H_ #ifdef __cplusplus extern "C" { #endif #include <linux/netlink.h> #include <sys/socket.h> // 与内核相同的定义 #define NETLINK_GPIO_EVENT 31 #define SRVC_GPIO_RESET_STACK_SIZE_DEFAULT 10240 #define SRVC_GPIO_RESET_PRIO_DEFAULT PAL_THREAD_PRIO_IGNORE #define GPIO_RESET_PRVT_SRVC 0 // Netlink消息结构(与内核保持一致) struct gpio_netlink_msg { char button_name[32]; unsigned int event_type; int value; unsigned long timestamp; }; int gpioResetSrvc(void *param); int gpioResetSrvcExit(void *param); #ifdef __cplusplus } #endif #endif // _SRVC_GPIO_RESET_H_
10-14
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值