Coder Social home page Coder Social logo

Comments (3)

kotronis-te avatar kotronis-te commented on August 15, 2024

Btw for the netmask inclusion, it seems that validation is fine

func ValidatePrefixParam(value string) (string, error) {
	return ValidateLengthAndCharset(value, 80, "1234567890abcdef.:/")
}

however I am not sure how to pass the netmask, escaping the / does not seem to work. Maybe due to this underlying issue?
julienschmidt/httprouter#208

Also regarding the v6, it seems that by default the lookup is in the master table

func RouteNet(r *http.Request, ps httprouter.Params, useCache bool) (bird.Parsed, bool) {
	net, err := ValidatePrefixParam(ps.ByName("net"))
	if err != nil {
		return bird.Parsed{"error": fmt.Sprintf("%s", err)}, false
	}

	return bird.RoutesLookupTable(useCache, net, "master")
}

so it actually needs to use the /table/master6 extension for v6.

However, let me know if you have any ideas or working examples w.r.t. the netmask inclusion in the :net param...

from birdwatcher.

kotronis-te avatar kotronis-te commented on August 15, 2024

Btw it seems that there is some v4/v6 distinction for bird and bird6 here:

return cmd + " where net.type = NET_IP" + IPVersion

This should not apply for bird2 right? I.e., the query should detect the version of the network and use that one, and not set everything on the application layer.

from birdwatcher.

kotronis-te avatar kotronis-te commented on August 15, 2024

I issued a PR for the v6 problem when looking up routes (tested locally and works):
#52

However, it can probably be closed if you merge #30

I will issue a separate PR for the netmask endpoint

from birdwatcher.

Related Issues (20)

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.