github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/app/router/command/command.proto (about)

     1  syntax = "proto3";
     2  
     3  package v2ray.core.app.router.command;
     4  option csharp_namespace = "V2Ray.Core.App.Router.Command";
     5  option go_package = "github.com/v2fly/v2ray-core/v5/app/router/command";
     6  option java_package = "com.v2ray.core.app.router.command";
     7  option java_multiple_files = true;
     8  
     9  import "common/protoext/extensions.proto";
    10  import "common/net/network.proto";
    11  
    12  // RoutingContext is the context with information relative to routing process.
    13  // It conforms to the structure of v2ray.core.features.routing.Context and
    14  // v2ray.core.features.routing.Route.
    15  message RoutingContext {
    16    string InboundTag = 1;
    17    v2ray.core.common.net.Network Network = 2;
    18    repeated bytes SourceIPs = 3;
    19    repeated bytes TargetIPs = 4;
    20    uint32 SourcePort = 5;
    21    uint32 TargetPort = 6;
    22    string TargetDomain = 7;
    23    string Protocol = 8;
    24    string User = 9;
    25    map<string, string> Attributes = 10;
    26    repeated string OutboundGroupTags = 11;
    27    string OutboundTag = 12;
    28  }
    29  
    30  // SubscribeRoutingStatsRequest subscribes to routing statistics channel if
    31  // opened by v2ray-core.
    32  // * FieldSelectors selects a subset of fields in routing statistics to return.
    33  // Valid selectors:
    34  //  - inbound: Selects connection's inbound tag.
    35  //  - network: Selects connection's network.
    36  //  - ip: Equivalent as "ip_source" and "ip_target", selects both source and
    37  //  target IP.
    38  //  - port: Equivalent as "port_source" and "port_target", selects both source
    39  //  and target port.
    40  //  - domain: Selects target domain.
    41  //  - protocol: Select connection's protocol.
    42  //  - user: Select connection's inbound user email.
    43  //  - attributes: Select connection's additional attributes.
    44  //  - outbound: Equivalent as "outbound" and "outbound_group", select both
    45  //  outbound tag and outbound group tags.
    46  // * If FieldSelectors is left empty, all fields will be returned.
    47  message SubscribeRoutingStatsRequest {
    48    repeated string FieldSelectors = 1;
    49  }
    50  
    51  // TestRouteRequest manually tests a routing result according to the routing
    52  // context message.
    53  // * RoutingContext is the routing message without outbound information.
    54  // * FieldSelectors selects the fields to return in the routing result. All
    55  // fields are returned if left empty.
    56  // * PublishResult broadcasts the routing result to routing statistics channel
    57  // if set true.
    58  message TestRouteRequest {
    59    RoutingContext RoutingContext = 1;
    60    repeated string FieldSelectors = 2;
    61    bool PublishResult = 3;
    62  }
    63  
    64  message PrincipleTargetInfo {
    65    repeated string tag = 1;
    66  }
    67  
    68  message OverrideInfo {
    69    string target = 2;
    70  }
    71  
    72  message BalancerMsg {
    73    OverrideInfo override = 5;
    74    PrincipleTargetInfo principle_target = 6;
    75  }
    76  
    77  message GetBalancerInfoRequest {
    78    string tag = 1;
    79  }
    80  
    81  message GetBalancerInfoResponse {
    82    BalancerMsg balancer = 1;
    83  }
    84  
    85  message OverrideBalancerTargetRequest {
    86    string balancerTag = 1;
    87    string target = 2;
    88  }
    89  
    90  message OverrideBalancerTargetResponse {}
    91  
    92  service RoutingService {
    93    rpc SubscribeRoutingStats(SubscribeRoutingStatsRequest)
    94        returns (stream RoutingContext) {}
    95    rpc TestRoute(TestRouteRequest) returns (RoutingContext) {}
    96  
    97    rpc GetBalancerInfo(GetBalancerInfoRequest) returns (GetBalancerInfoResponse){}
    98    rpc OverrideBalancerTarget(OverrideBalancerTargetRequest) returns (OverrideBalancerTargetResponse) {}
    99  }
   100  
   101  message Config {
   102    option (v2ray.core.common.protoext.message_opt).type = "grpcservice";
   103    option (v2ray.core.common.protoext.message_opt).short_name = "router";
   104  }