// RouteAdd will add a route to the system.
// Equivalent to: `ip route add $route`
197028
func (h *Handle) RouteAdd(route *Route) error {
	flags := unix.NLM_F_CREATE | unix.NLM_F_EXCL | unix.NLM_F_ACK
	req := h.newNetlinkRequest(unix.RTM_NEWROUTE, flags)
	return h.routeHandle(route, req, nl.NewRtMsg())
}
335030
func (a *AliasAddAction) Routing(routing string) *AliasAddAction {
	a.routing = routing
	return a
}
340512
func AddRoute(endpoints []HNSEndpoint, destinationPrefix string, nextHop string, encapEnabled bool) (*PolicyList, error) {
	return hns.AddRoute(endpoints, destinationPrefix, nextHop, encapEnabled)
}
899155
func (s *Server) addRouter(r router.Router) {
	s.routers = append(s.routers, r)
}
1105322
func (s *ServerRPC) ServiceAdd(ctx context.Context, req *types.ServiceAddRequest) (*types.ServiceAddResponse, error) {
	err := s.daemon.AddService(req.PodID, req.Services)
	if err != nil {
		return nil, err
	}

	return &types.ServiceAddResponse{}, nil
}
736529
func (b *BigIP) CreateRoute(name, dest, gateway string) error {
	config := &Route{
		Name:    name,
		Network: dest,
		Gateway: gateway,
	}

	return b.post(config, uriNet, uriRoute)
}
635047
func (r *Routes) Append(routes ...*Routes) Routes {
	res := Routes{}
	// copy current route
	for _, route := range *r {
		res = append(res, route)
	}
	for _, _routes := range routes {
		for _, route := range *_routes {
			res = append(res, route)
		}
	}
	return res
}
595556
func (h *Handle) LinkAdd(link Link) error {
	return h.linkModify(link, unix.NLM_F_CREATE|unix.NLM_F_EXCL|unix.NLM_F_ACK)
}
1064526
func (s *Server) Put(route string, handler interface{}) {
	s.addRoute(route, "PUT", handler)
}
405350
func (r *Router) Put(path string, h http.HandlerFunc) {
	r.rtr.PUT(r.prefix+path, r.handle(path, h))
}
1323691
func RegisterRouter(router types.Router) {
	routersRWL.Lock()
	defer routersRWL.Unlock()
	routers = append(routers, router)
}
1162070
func (h *RouteMux) addRoute(r *route) {
	//and finally append to the list of Routes
	//create the Route
	h.routes = append(h.routes, r)
}
945609
func (this *Router) AddRoute(verb string, path string, funcs ...func(*Request, *Response, func())) {

	route := &Route{
		Method:        strings.ToUpper(verb),
		Path:          path,
		Callbacks:     funcs,
		CaseSensitive: this.CaseSensitive,
		Strict:        this.Strict,
	}

	this.Routes = append(this.Routes, route)
}
408987
func AddAddrs(addrs ...btcutil.Address) UpdateOption {
	return func(uo *updateOptions) {
		uo.addrs = append(uo.addrs, addrs...)
	}
}
59307
func (fs RouteFileStore) Add(route *Route) error {
	return ioutil.WriteFile(fs.Filename(route.ID), marshal(route), 0644)
}
833557
func (srv *Server) AddRoute(path string, f Function) {
	if srv.rtable == nil {
		srv.rtable = make(map[string]Function)
	}
	srv.rtable[path] = f
}
245749
func (r *Router) Add(method string, path string, handler HandlerFunc) {
	_logger.debug("===Add")
	if len(path) == 0 {
		panic("router: path couldn't be empty")
	}
	if path[0] != '/' {
		panic("router: path was invalid")
	}
	if len(path) > 1 {
		path = path[1:]
	}
	_logger.debug("path:" + path)

	currentNode := r.tree.rootNode
	if path == "/" {
		currentNode.addHandler(method, handler)
		return
	}

	pathArray := strings.Split(path, "/")
	count := len(pathArray)
	pathParams := []string{}

	for index, element := range pathArray {
		if len(element) == 0 {
			continue
		}

		var childNode *node
		firstSymbol := element[0]
		if firstSymbol == ':' {
			// this is parameter node
			pName := element[1:]
			_logger.debug("parameter_node_pname:" + pName)
			childNode = currentNode.findChildByKind(pkind)
			if childNode == nil {
				childNode = newNode(pName, pkind)
				currentNode.addChild(childNode)
			}

			isFound := false
			for _, p := range childNode.pNames {
				if p == pName {
					isFound = true
				}
			}

			if isFound == false {
				childNode.pNames = append(childNode.pNames, pName)
				_logger.debug("add_parameter_name:" + pName)
			}

			pathParams = append(pathParams, pName)

		} else if firstSymbol == '*' {
			// this is match any node.  We should allow one match any node only.
			pName := element[1:]
			_logger.debug("match_node_pname:" + pName)
			childNode = currentNode.findChildByKind(akind)
			if childNode == nil {
				childNode = newNode(pName, akind)
				currentNode.addChild(childNode)
				childNode.pNames = append(childNode.pNames, pName)
			}

			pathParams = append(pathParams, pName)

		} else {
			// this is static node
			childNode = currentNode.findChildByName(element)
			if childNode == nil {
				childNode = newNode(element, skind)
				currentNode.addChild(childNode)
			}
		}

		// last node in the path
		if count == index+1 {
			childNode.params = pathParams
			childNode.addHandler(method, handler)
		}

		currentNode = childNode
	}

}