| 2229 | } |
| 2230 | |
| 2231 | func (n Nexthop) string() string { |
| 2232 | s := make([]string, 0) |
| 2233 | s = append(s, fmt.Sprintf( |
| 2234 | "type: %s, vrf_id: %d, ifindex: %d, flags: %d, gate: %s, blackholeType: %d, label_num: %d, weight: %d, backupNum: %d, srteColor: %d", |
| 2235 | n.Type.String(), n.VrfID, n.Ifindex, n.flags, n.Gate.String(), |
| 2236 | n.blackholeType, n.LabelNum, n.Weight, n.backupNum, n.srteColor)) |
| 2237 | for i := range n.LabelNum { |
| 2238 | s = append(s, fmt.Sprintf(" label[%d]: %d", i, n.MplsLabels[i])) |
| 2239 | } |
| 2240 | for i := range n.backupNum { |
| 2241 | s = append(s, fmt.Sprintf(" backupIndex[%d]: %d", i, n.backupIndex[i])) |
| 2242 | } |
| 2243 | return strings.Join(s, ", ") |
| 2244 | } |
| 2245 | |
| 2246 | func (n Nexthop) gateToType(version uint8) nexthopType { |
| 2247 | if n.Gate.Is4() { |