dhcp

package
v0.0.0-...-26a5939 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright © 2022 lilo <luolee.me@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerVIP string
	MaxCIDR   string
	Mtu       int
)

Functions

func Call

func Call(svcName string, svcMethod string, req Request, res interface{}) error

func NewRPCServer

func NewRPCServer(host host.Host, zone string, cidr string, mtu int, subnets []string)

Types

type DHCPService

type DHCPService struct {
	// bind to database or KV store
	KV map[string]Response
	// should be 192.168.1.1/24 for example
	Cidr string
	Mtu  int
}

func (*DHCPService) Clients

func (s *DHCPService) Clients(ctx context.Context, req Request, res *[]Response) error

func (*DHCPService) DHCP

func (s *DHCPService) DHCP(ctx context.Context, req Request, res *Response) error

func (*DHCPService) Ping

func (s *DHCPService) Ping(ctx context.Context, req Request, res *Response) error

type RPC

type RPC struct {
}

type Request

type Request struct {
	Id      string
	Mode    int
	Name    string
	Subnets []string
}

type Response

type Response struct {
	Id        string
	Name      string
	Ip        string
	Mtu       int
	Subnets   []string
	ServerVIP string
	Mode      int
	Ttl       int64
	LoginTime int64
}

func NewRPCClient

func NewRPCClient(host host.Host, zone string, server string, req Request) (*rpc.Client, Response)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL