Documentation
¶
Overview ¶
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * 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 ¶
- type PMC
- func (pmc *PMC) GetCredential() *credential.Credential
- func (pmc *PMC) GetIp() net.IP
- func (pmc *PMC) GetMac() net.HardwareAddr
- func (pmc *PMC) GetVendor() vendor.Vendor
- func (pmc *PMC) Patch(to PMC) bool
- func (pmc *PMC) SetCredential(cred *credential.Credential)
- func (pmc *PMC) SetIP(ip string)
- func (pmc *PMC) SetVendor(v vendor.VendorCode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PMC ¶
type PMC struct {
MAC net.HardwareAddr `json:"mac"`
IP net.IP `json:"ip"`
Vendor vendor.Vendor `json:"vendor"`
Credential *credential.Credential `json:"credential"`
}
PMC specifies the information for a PMC which includes MAC address, IP address, and access credential.
func New ¶
func New(mac string, ip string, v vendor.VendorCode, cred *credential.Credential) (*PMC, error)
New creates a new PMC instance by parsing MAC and IP from strings. Use this at API boundaries (gRPC, REST) where addresses come as strings. For internal use with already-parsed addresses, prefer NewFromAddr.
func NewFromAddr ¶
func NewFromAddr(mac net.HardwareAddr, ip net.IP, v vendor.VendorCode, cred *credential.Credential) (*PMC, error)
NewFromAddr creates a new PMC instance from native net.HardwareAddr and net.IP types. This is the preferred constructor for internal use where addresses are already parsed.
func (*PMC) GetCredential ¶
func (pmc *PMC) GetCredential() *credential.Credential
GetCredential returns the PMC credential or nil.
func (*PMC) SetCredential ¶
func (pmc *PMC) SetCredential(cred *credential.Credential)
SetCredential sets the credential for the PMC.