diff --git a/server/analyseapi/app.go b/server/analyseapi/app.go index 77f3fcf..eb0b33f 100644 --- a/server/analyseapi/app.go +++ b/server/analyseapi/app.go @@ -15,15 +15,17 @@ func (this *App_) Init() { f5.App.SetPkgName("analyseapi") this.App_.Init() G.MetaMgr = new(MetaMgr).Init() - G.HttpServer = new(f5.HttpServer).Init() + G.RiskMgr = new(RiskMgr).Init() G.GameLog = new(GameLog).Init() + G.HttpServer = new(f5.HttpServer).Init() G.HttpServer.Start(G.MetaMgr.GetServer(1).GetListenPort()); } func (this *App_) UnInit() { - G.GameLog.UnInit() G.HttpServer.UnInit() + G.GameLog.UnInit() + G.RiskMgr.UnInit() G.MetaMgr.UnInit() this.App_.UnInit() } diff --git a/server/analyseapi/g.go b/server/analyseapi/g.go index 6c32773..c4385fb 100644 --- a/server/analyseapi/g.go +++ b/server/analyseapi/g.go @@ -8,6 +8,7 @@ type GlobalVar struct { MetaMgr *MetaMgr HttpServer *f5.HttpServer GameLog *GameLog + RiskMgr *RiskMgr } var G *GlobalVar = &GlobalVar{} diff --git a/server/analyseapi/metamgr.go b/server/analyseapi/metamgr.go index a2bcfe9..e555336 100644 --- a/server/analyseapi/metamgr.go +++ b/server/analyseapi/metamgr.go @@ -1,7 +1,9 @@ package main -import "f5" -import "mt" +import ( + "f5" + "mt" +) const ( MT_SERVER_INFO = 0 diff --git a/server/analyseapi/metawrap.go b/server/analyseapi/metawrap.go index e67f656..ff1f262 100644 --- a/server/analyseapi/metawrap.go +++ b/server/analyseapi/metawrap.go @@ -5,3 +5,11 @@ import "mt" type MtwServerInfo struct { *mt.ServerInfo } + +type MtwWhiteList struct { + *mt.WhiteList +} + +type MtwBlackList struct { + *mt.BlackList +} diff --git a/server/analyseapi/riskmgr.go b/server/analyseapi/riskmgr.go new file mode 100644 index 0000000..a2fb980 --- /dev/null +++ b/server/analyseapi/riskmgr.go @@ -0,0 +1,20 @@ +package main + +type RiskMgr struct { + +} + +func (this* RiskMgr) Init() *RiskMgr { + return this +} + +func (this* RiskMgr) UnInit() { +} + +func (this* RiskMgr) InWhiteList(ip string) bool { + return false +} + +func (this* RiskMgr) InBlackList(ip string) bool { + return false +} diff --git a/server/tools/protobuild/mt.proto b/server/tools/protobuild/mt.proto index 67dcced..1a4281a 100644 --- a/server/tools/protobuild/mt.proto +++ b/server/tools/protobuild/mt.proto @@ -13,3 +13,23 @@ message ServerInfoMetas { repeated ServerInfo values = 1; } + +message WhiteList +{ + repeated string ip_tables = 1; +} + +message WhiteListMetas +{ + repeated WhiteList values = 1; +} + +message BlackList +{ + repeated string ip_tables = 1; +} + +message BlackListMetas +{ + repeated WhiteList values = 1; +}