(entry *agent.GPIDSyncEntry)
| 369 | } |
| 370 | |
| 371 | func AformatEntries(entry *agent.GPIDSyncEntry) string { |
| 372 | buffer := bytes.Buffer{} |
| 373 | format := "{protocol: %d, epc_id_1: %d, ipv4_1: %s, port_1: %d, pid_1: %d, " + |
| 374 | "epc_id_0: %d, ipv4_0: %s, port_0: %d, pid_0: %d, epc_id_real: %d, " + |
| 375 | "ipv4_real: %s, port_real: %d, pid_real: %d, role_real: %d, netns_idx: %d}" |
| 376 | buffer.WriteString(fmt.Sprintf(format, |
| 377 | entry.GetProtocol(), entry.GetEpcId_1(), utils.IpFromUint32(entry.GetIpv4_1()).String(), entry.GetPort_1(), entry.GetPid_1(), |
| 378 | entry.GetEpcId_0(), utils.IpFromUint32(entry.GetIpv4_0()).String(), entry.GetPort_0(), entry.GetPid_0(), entry.GetEpcIdReal(), |
| 379 | utils.IpFromUint32(entry.GetIpv4Real()).String(), entry.GetPortReal(), entry.GetPidReal(), entry.GetRoleReal(), entry.GetNetnsIdx()), |
| 380 | ) |
| 381 | return buffer.String() |
| 382 | } |
| 383 | |
| 384 | func getAgentConn(cmd *cobra.Command) *grpc.ClientConn { |
| 385 | server := common.GetServerInfo(cmd) |
no test coverage detected