From 91f2a40dae7ac021c5d4b9aac1789060faf7065c Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 26 Sep 2016 15:14:16 +0200 Subject: [PATCH] refine proto package names --- app/dns/config.proto | 8 +++++--- common/net/address.proto | 4 +++- common/net/destination.proto | 4 +++- common/net/network.proto | 4 +++- common/net/port.proto | 4 +++- common/protocol/server_spec.proto | 12 +++++++----- common/protocol/user.proto | 8 +++++--- proxy/blackhole/config.proto | 4 +++- proxy/dokodemo/config.proto | 8 +++++--- proxy/freedom/config.proto | 4 +++- proxy/http/config.proto | 4 +++- proxy/shadowsocks/config.proto | 8 +++++--- proxy/socks/config.proto | 8 +++++--- proxy/vmess/account.proto | 5 ++++- proxy/vmess/inbound/config.proto | 6 ++++-- proxy/vmess/outbound/config.proto | 6 ++++-- transport/internet/authenticator.proto | 4 +++- transport/internet/authenticators/noop/config.proto | 4 +++- transport/internet/authenticators/srtp/config.proto | 4 +++- transport/internet/authenticators/utp/config.proto | 4 +++- transport/internet/kcp/config.proto | 6 ++++-- 21 files changed, 81 insertions(+), 38 deletions(-) diff --git a/app/dns/config.proto b/app/dns/config.proto index 5fe671e90..5baee5a0e 100644 --- a/app/dns/config.proto +++ b/app/dns/config.proto @@ -1,12 +1,14 @@ syntax = "proto3"; -package com.v2ray.core.app.dns; +package v2ray.core.app.dns; option go_package = "dns"; +option java_package = "com.v2ray.core.app.dns"; +option java_outer_classname = "ConfigProto"; import "v2ray.com/core/common/net/address.proto"; import "v2ray.com/core/common/net/destination.proto"; message Config { - repeated com.v2ray.core.common.net.DestinationPB NameServers = 1; - map Hosts = 2; + repeated v2ray.core.common.net.DestinationPB NameServers = 1; + map Hosts = 2; } diff --git a/common/net/address.proto b/common/net/address.proto index f23ebbaa0..2eea9d319 100644 --- a/common/net/address.proto +++ b/common/net/address.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.common.net; +package v2ray.core.common.net; option go_package = "net"; +option java_package = "com.v2ray.core.common.net"; +option java_outer_classname = "AddressProto"; message AddressPB { oneof address { diff --git a/common/net/destination.proto b/common/net/destination.proto index b776e9f3b..45a80b7e6 100644 --- a/common/net/destination.proto +++ b/common/net/destination.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.common.net; +package v2ray.core.common.net; option go_package = "net"; +option java_package = "com.v2ray.core.common.net"; +option java_outer_classname = "DestinationProto"; import "v2ray.com/core/common/net/network.proto"; import "v2ray.com/core/common/net/address.proto"; diff --git a/common/net/network.proto b/common/net/network.proto index acc1adbd6..7383715b7 100644 --- a/common/net/network.proto +++ b/common/net/network.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.common.net; +package v2ray.core.common.net; option go_package = "net"; +option java_package = "com.v2ray.core.common.net"; +option java_outer_classname = "NetworkProto"; enum Network { Unknown = 0; diff --git a/common/net/port.proto b/common/net/port.proto index fff9e7727..1f0e7b1c3 100644 --- a/common/net/port.proto +++ b/common/net/port.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.common.net; +package v2ray.core.common.net; option go_package = "net"; +option java_package = "com.v2ray.core.common.net"; +option java_outer_classname = "PortProto"; // PortRange represents a range of ports. message PortRange { diff --git a/common/protocol/server_spec.proto b/common/protocol/server_spec.proto index 84f9577a2..ce9df473c 100644 --- a/common/protocol/server_spec.proto +++ b/common/protocol/server_spec.proto @@ -1,13 +1,15 @@ syntax = "proto3"; +package v2ray.core.common.protocol; +option go_package = "protocol"; +option java_package = "com.v2ray.core.common.protocol"; +option java_outer_classname = "ServerSpecProto"; + import "v2ray.com/core/common/net/address.proto"; import "v2ray.com/core/common/protocol/user.proto"; -package com.v2ray.core.common.protocol; -option go_package = "protocol"; - message ServerSpecPB { - com.v2ray.core.common.net.AddressPB address = 1; + v2ray.core.common.net.AddressPB address = 1; uint32 port = 2; - repeated com.v2ray.core.common.protocol.User user = 3; + repeated v2ray.core.common.protocol.User user = 3; } \ No newline at end of file diff --git a/common/protocol/user.proto b/common/protocol/user.proto index f7f674cad..1dfe12539 100644 --- a/common/protocol/user.proto +++ b/common/protocol/user.proto @@ -1,9 +1,11 @@ syntax = "proto3"; -import "google/protobuf/any.proto"; - -package com.v2ray.core.common.protocol; +package v2ray.core.common.protocol; option go_package = "protocol"; +option java_package = "com.v2ray.core.common.protocol"; +option java_outer_classname = "UserProto"; + +import "google/protobuf/any.proto"; message User { uint32 level = 1; diff --git a/proxy/blackhole/config.proto b/proxy/blackhole/config.proto index 68fdd8bbb..a8eb59727 100644 --- a/proxy/blackhole/config.proto +++ b/proxy/blackhole/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.proxy.blackhole; +package v2ray.core.proxy.blackhole; option go_package = "blackhole"; +option java_package = "com.v2ray.core.proxy.blackhole"; +option java_outer_classname = "ConfigProto"; import "google/protobuf/any.proto"; diff --git a/proxy/dokodemo/config.proto b/proxy/dokodemo/config.proto index 54bfdd0fd..c6cda536e 100644 --- a/proxy/dokodemo/config.proto +++ b/proxy/dokodemo/config.proto @@ -1,15 +1,17 @@ syntax = "proto3"; -package com.v2ray.core.proxy.dokodemo; +package v2ray.core.proxy.dokodemo; option go_package = "dokodemo"; +option java_package = "com.v2ray.core.proxy.dokodemo"; +option java_outer_classname = "ConfigProto"; import "v2ray.com/core/common/net/address.proto"; import "v2ray.com/core/common/net/network.proto"; message Config { - com.v2ray.core.common.net.AddressPB address = 1; + v2ray.core.common.net.AddressPB address = 1; uint32 port = 2; - com.v2ray.core.common.net.NetworkList network_list = 3; + v2ray.core.common.net.NetworkList network_list = 3; uint32 timeout = 4; bool follow_redirect = 5; } \ No newline at end of file diff --git a/proxy/freedom/config.proto b/proxy/freedom/config.proto index 20c48cd87..4a8c51cd6 100644 --- a/proxy/freedom/config.proto +++ b/proxy/freedom/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.proxy.freedom; +package v2ray.core.proxy.freedom; option go_package = "freedom"; +option java_package = "com.v2ray.core.proxy.freedom"; +option java_outer_classname = "ConfigProto"; message Config { enum DomainStrategy { diff --git a/proxy/http/config.proto b/proxy/http/config.proto index 286520ab4..b323aa65b 100644 --- a/proxy/http/config.proto +++ b/proxy/http/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.proxy.http; +package v2ray.core.proxy.http; option go_package = "http"; +option java_package = "com.v2ray.core.proxy.http"; +option java_outer_classname = "ConfigProto"; // Config for HTTP proxy server. message ServerConfig { diff --git a/proxy/shadowsocks/config.proto b/proxy/shadowsocks/config.proto index f7c273071..b228eac2c 100644 --- a/proxy/shadowsocks/config.proto +++ b/proxy/shadowsocks/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.proxy.shadowsocks; +package v2ray.core.proxy.shadowsocks; option go_package = "shadowsocks"; +option java_package = "com.v2ray.core.proxy.shadowsocks"; +option java_outer_classname = "ConfigProto"; import "v2ray.com/core/common/protocol/user.proto"; import "v2ray.com/core/common/protocol/server_spec.proto"; @@ -21,9 +23,9 @@ enum CipherType { message ServerConfig { bool udp_enabled = 1; - com.v2ray.core.common.protocol.User user = 2; + v2ray.core.common.protocol.User user = 2; } message ClientConfig { - repeated com.v2ray.core.common.protocol.ServerSpecPB server = 1; + repeated v2ray.core.common.protocol.ServerSpecPB server = 1; } \ No newline at end of file diff --git a/proxy/socks/config.proto b/proxy/socks/config.proto index 5f69871aa..2a40a28fb 100644 --- a/proxy/socks/config.proto +++ b/proxy/socks/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.proxy.socks; +package v2ray.core.proxy.socks; option go_package = "socks"; +option java_package = "com.v2ray.core.proxy.socks"; +option java_outer_classname = "ConfigProto"; import "v2ray.com/core/common/net/address.proto"; import "v2ray.com/core/common/protocol/server_spec.proto"; @@ -19,11 +21,11 @@ enum AuthType { message ServerConfig { AuthType auth_type = 1; map accounts = 2; - com.v2ray.core.common.net.AddressPB address = 3; + v2ray.core.common.net.AddressPB address = 3; bool udp_enabled = 4; uint32 timeout = 5; } message ClientConfig { - repeated com.v2ray.core.common.protocol.ServerSpecPB server = 1; + repeated v2ray.core.common.protocol.ServerSpecPB server = 1; } \ No newline at end of file diff --git a/proxy/vmess/account.proto b/proxy/vmess/account.proto index 5d49bdd00..dd6c8e8d6 100644 --- a/proxy/vmess/account.proto +++ b/proxy/vmess/account.proto @@ -1,8 +1,11 @@ syntax = "proto3"; -package com.v2ray.core.proxy.vmess; +package v2ray.core.proxy.vmess; option go_package = "vmess"; +option java_package = "com.v2ray.core.proxy.vmess"; +option java_outer_classname = "AccountProto"; + message AccountPB { string id = 1; uint32 alter_id = 2; diff --git a/proxy/vmess/inbound/config.proto b/proxy/vmess/inbound/config.proto index 0b640dbe0..4690f0119 100644 --- a/proxy/vmess/inbound/config.proto +++ b/proxy/vmess/inbound/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.proxy.vmess.inbound; +package v2ray.core.proxy.vmess.inbound; option go_package = "inbound"; +option java_package = "com.v2ray.core.proxy.vmess.inbound"; +option java_outer_classname = "ConfigProto"; import "v2ray.com/core/common/protocol/user.proto"; @@ -15,7 +17,7 @@ message DefaultConfig { } message Config { - repeated com.v2ray.core.common.protocol.User user = 1; + repeated v2ray.core.common.protocol.User user = 1; DefaultConfig default = 2; DetourConfig detour = 3; } \ No newline at end of file diff --git a/proxy/vmess/outbound/config.proto b/proxy/vmess/outbound/config.proto index 10a7c59e1..332cc0e8d 100644 --- a/proxy/vmess/outbound/config.proto +++ b/proxy/vmess/outbound/config.proto @@ -1,10 +1,12 @@ syntax = "proto3"; -package com.v2ray.core.proxy.vmess.outbound; +package v2ray.core.proxy.vmess.outbound; option go_package = "outbound"; +option java_package = "com.v2ray.core.proxy.vmess.outbound"; +option java_outer_classname = "ConfigProto"; import "v2ray.com/core/common/protocol/server_spec.proto"; message Config { - repeated com.v2ray.core.common.protocol.ServerSpecPB Receiver = 1; + repeated v2ray.core.common.protocol.ServerSpecPB Receiver = 1; } \ No newline at end of file diff --git a/transport/internet/authenticator.proto b/transport/internet/authenticator.proto index 3d5976fa8..ebca2eedb 100644 --- a/transport/internet/authenticator.proto +++ b/transport/internet/authenticator.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.transport.internet; +package v2ray.core.transport.internet; option go_package = "internet"; +option java_package = "com.v2ray.core.transport.internet"; +option java_outer_classname = "AuthenticatorProto"; import "google/protobuf/any.proto"; diff --git a/transport/internet/authenticators/noop/config.proto b/transport/internet/authenticators/noop/config.proto index c0a859f36..8272290d9 100644 --- a/transport/internet/authenticators/noop/config.proto +++ b/transport/internet/authenticators/noop/config.proto @@ -1,6 +1,8 @@ syntax = "proto3"; -package com.v2ray.core.transport.internet.authenticators.noop; +package v2ray.core.transport.internet.authenticators.noop; option go_package = "noop"; +option java_package = "com.v2ray.core.transport.internet.authenticators.noop"; +option java_outer_classname = "ConfigProto"; message Config {} \ No newline at end of file diff --git a/transport/internet/authenticators/srtp/config.proto b/transport/internet/authenticators/srtp/config.proto index 782c01e3a..1f27a1a36 100644 --- a/transport/internet/authenticators/srtp/config.proto +++ b/transport/internet/authenticators/srtp/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.transport.internet.authenticators.srtp; +package v2ray.core.transport.internet.authenticators.srtp; option go_package = "srtp"; +option java_package = "com.v2ray.core.transport.internet.authenticators.srtp"; +option java_outer_classname = "ConfigProto"; message Config { uint32 version = 1; diff --git a/transport/internet/authenticators/utp/config.proto b/transport/internet/authenticators/utp/config.proto index 6526ccff3..2a3630c87 100644 --- a/transport/internet/authenticators/utp/config.proto +++ b/transport/internet/authenticators/utp/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.transport.internet.authenticators.utp; +package v2ray.core.transport.internet.authenticators.utp; option go_package = "utp"; +option java_package = "com.v2ray.core.transport.internet.authenticators.utp"; +option java_outer_classname = "ConfigProto"; message Config { uint32 version = 1; diff --git a/transport/internet/kcp/config.proto b/transport/internet/kcp/config.proto index b19424860..75bc2bf0c 100644 --- a/transport/internet/kcp/config.proto +++ b/transport/internet/kcp/config.proto @@ -1,7 +1,9 @@ syntax = "proto3"; -package com.v2ray.core.transport.internet.kcp; +package v2ray.core.transport.internet.kcp; option go_package = "kcp"; +option java_package = "com.v2ray.core.transport.internet.kcp"; +option java_outer_classname = "ConfigProto"; import "v2ray.com/core/transport/internet/authenticator.proto"; @@ -43,5 +45,5 @@ message Config { bool congestion = 5; WriteBuffer write_buffer = 6; ReadBuffer read_buffer = 7; - com.v2ray.core.transport.internet.AuthenticatorConfig header_config = 8; + v2ray.core.transport.internet.AuthenticatorConfig header_config = 8; } \ No newline at end of file