| 1 | syntax = "proto3"; |
| 2 | |
| 3 | package bio.route; |
| 4 | |
| 5 | import "net/api/net.proto"; |
| 6 | option go_package = "github.com/bio-routing/bio-rd/route/api"; |
| 7 | |
| 8 | message Route { |
| 9 | bio.net.Prefix pfx = 1; |
| 10 | repeated Path paths = 2; |
| 11 | } |
| 12 | |
| 13 | message Path { |
| 14 | enum Type { |
| 15 | Static = 0; |
| 16 | BGP = 1; |
| 17 | GRP = 2; |
| 18 | } |
| 19 | enum HiddenReason { |
| 20 | HiddenReasonNone = 0; |
| 21 | HiddenReasonNextHopUnreachable = 1; |
| 22 | HiddenReasonFilteredByPolicy = 2; |
| 23 | HiddenReasonASLoop = 3; |
| 24 | HiddenReasonOurOriginatorID = 4; |
| 25 | HiddenReasonClusterLoop = 5; |
| 26 | HiddenReasonOTCMismatch = 6; |
| 27 | } |
| 28 | Type type = 1; |
| 29 | StaticPath static_path = 2; |
| 30 | BGPPath bgp_path = 3; |
| 31 | HiddenReason hidden_reason = 4; |
| 32 | uint32 time_learned = 5; |
| 33 | GRPPath grp_path = 6; |
| 34 | } |
| 35 | |
| 36 | message StaticPath { |
| 37 | bio.net.IP next_hop = 1; |
| 38 | } |
| 39 | |
| 40 | message GRPPath { |
| 41 | bio.net.IP next_hop = 1; |
| 42 | map<string,string> meta_data = 2; |
| 43 | } |
| 44 | |
| 45 | message BGPPath { |
| 46 | uint32 path_identifier = 1; |
| 47 | bio.net.IP next_hop = 2; |
| 48 | uint32 local_pref = 3; |
| 49 | repeated ASPathSegment as_path = 4; |
| 50 | uint32 origin = 5; |
| 51 | uint32 med = 6; |
| 52 | bool ebgp = 7; |
| 53 | uint32 bgp_identifier = 8; |
| 54 | bio.net.IP source = 9; |
| 55 | repeated uint32 communities = 10; |
| 56 | repeated LargeCommunity large_communities = 11; |
| 57 | uint32 originator_id = 12; |
| 58 | repeated uint32 cluster_list = 13; |
| 59 | repeated UnknownPathAttribute unknown_attributes = 14; |
| 60 | bool bmp_post_policy = 15; |
| 61 | uint32 only_to_customer = 16; |
| 62 | } |
| 63 | |
| 64 | message ASPathSegment { |
| 65 | bool as_sequence = 1; |
| 66 | repeated uint32 asns = 2; |
| 67 | } |
| 68 | |
| 69 | message LargeCommunity { |
| 70 | uint32 global_administrator = 1; |
| 71 | uint32 data_part1 = 2; |
| 72 | uint32 data_part2 = 3; |
| 73 | } |
| 74 | |
| 75 | message UnknownPathAttribute { |
| 76 | bool optional = 1; |
| 77 | bool transitive = 2; |
| 78 | bool partial = 3; |
| 79 | uint32 type_code = 4; |
| 80 | bytes value = 5; |
| 81 | } |