Giter VIP home page Giter VIP logo

gnl2go's People

Contributors

tehnerd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gnl2go's Issues

GetPoolForService() should return error if service not exist

I use GetPoolForService() to detect if a Service exist. I expect GetPoolForService() to return error if Service not exist. However, it return a Service with attribute I passed in, and error as nil.

Does this works as intended, or is a bug?

sched flags not working

Hi @kobolog , @tehnerd , thanks for your answers in this gorb issue . I was reviewing all the useful information you gave to me and now I understand a little more how this works.

I reviewed the changes that @tehnerd made in this commit and it seems like it's almost the functionality I was looking for. However, I couldn't make it work: even if I configured the flags, they did not have any effect and the library worked as usual.

The main function I used to test is in this gist but the output is:
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
UDP 192.168.1.22:50100 sh
-> 192.168.1.22:8080 Masq 10 0 0
-> 192.168.1.22:8081 Masq 10 0 0

While if I do it with:
ipvsadm -A -u 192.168.0.2:50100 -s sh -b sh-fallback
ipvsadm -a -u 192.168.0.2:50100 -r 192.168.0.2:40058 -m -w 10
ipvsadm -a -u 192.168.0.2:50100 -r 192.168.0.2:40059 -m -w 10

The output is:
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
UDP 192.168.0.2:50100 sh (sh-fallback)
-> 192.168.0.2:40058 Masq 10 0 0
-> 192.168.0.2:40059 Masq 10 0 0
(Note the sh-fallback flag)

Also in the commit the flags are translated to a binary array but it may be mistranslated from the ipvsadm C.
Should it be IP_VS_SVC_F_SCHED2 = []byte{0, 0, 0, 0, 0, 0, 1, 0} /* scheduler flag 2 */ or
IP_VS_SVC_F_SCHED2 = []byte{0, 0, 0, 0, 0, 0, 0, 10} /* scheduler flag 2 */ ?

It would also be interesting to be able to use combinations of the flags such as
IP_VS_SVC_F_SH_FALLBACK_AND_PORT = []byte{0, 0, 0, 0, 0, 0, 0, 18} /* scheduler flag 2 */

GetPools() and GetPoolForService() does not return service flags

There is no "Flag []byte" field in Service struct, see

type Pool struct {
	Service Service
	Dests   []Dest
}

type Service struct {
	Proto  uint16
	VIP    string
	Port   uint16
	Sched  string
	FWMark uint32
	AF     uint16
}

Service flags are really useful, could you please kindly add it? I tried to delve into the code, and quickly realized that it's challenging for me to add it since I don't know how to decode netlink response.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.