// LnxSetAdvertisingData sets the advertising data to the HCI device.
// This option can be used with NewDevice or Option on Linux implementation.
492742
func LnxSetAdvertisingData(c *cmd.LESetAdvertisingData) Option {
	return func(d Device) error {
		d.(*device).advData = c
		return nil
	}
}
1217254
func (c *Cluster) GetAdvertiseAddress() string {
	c.mu.RLock()
	defer c.mu.RUnlock()
	if c.nr != nil && c.nr.config.AdvertiseAddr != "" {
		advertiseHost, _, _ := net.SplitHostPort(c.nr.config.AdvertiseAddr)
		return advertiseHost
	}
	return c.currentNodeState().actualLocalAddr
}
728766
func (s *PutMetricAlarmInput) SetTreatMissingData(v string) *PutMetricAlarmInput {
	s.TreatMissingData = &v
	return s
}
54448
func NewSignedData(eci EncapsulatedContentInfo) (*SignedData, error) {
	// The version is picked based on which CMS features are used. We only use
	// version 1 features, except for supporting non-data econtent.
	version := 1
	if !eci.IsTypeData() {
		version = 3
	}

	return &SignedData{
		Version:          version,
		DigestAlgorithms: []pkix.AlgorithmIdentifier{},
		EncapContentInfo: eci,
		SignerInfos:      []SignerInfo{},
	}, nil
}
875500
func (n *Node) newAdvertisement() *advertisement {
	return &advertisement{
		VersionType: vrrpVersionType,
		VRID:        n.VRID,
		Priority:    n.Priority,
		AdvertInt:   uint16(n.MasterAdvertInterval / time.Millisecond / 10), // AdvertInt is in centiseconds
	}
}
704812
func (s *Server) AdvertiseAddr() string {
	// set if we have explicit --advertise-ip option
	advertiseIP := s.getAdvertiseIP()
	if advertiseIP == "" {
		return s.addr.Addr
	}
	_, port, _ := net.SplitHostPort(s.addr.Addr)
	ahost, aport, err := utils.ParseAdvertiseAddr(advertiseIP)
	if err != nil {
		log.Warningf("Failed to parse advertise address %q, %v, using default value %q.", advertiseIP, err, s.addr.Addr)
		return s.addr.Addr
	}
	if aport == "" {
		aport = port
	}
	return fmt.Sprintf("%v:%v", ahost, aport)
}
677656
func (s *GetAuthorizationTokenOutput) SetAuthorizationData(v []*AuthorizationData) *GetAuthorizationTokenOutput {
	s.AuthorizationData = v
	return s
}
753235
func (s *Certificate) SetData(v string) *Certificate {
	s.Data = &v
	return s
}
793105
func (s *DirectMessageConfiguration) SetADMMessage(v *ADMMessage) *DirectMessageConfiguration {
	s.ADMMessage = v
	return s
}
741765
func LnxSetAdvertisingEnable(en bool) Option {
	return func(d Device) error {
		dd := d.(*device)
		if dd == nil {
			return errors.New("device is not initialized")
		}
		if err := dd.update(); err != nil {
			return err
		}
		return dd.hci.SetAdvertiseEnable(en)
	}
}
113517
func SetDownlinkTXInfoDataRate(txInfo *gw.DownlinkTXInfo, dr int, b band.Band) error {
	dataRate, err := b.GetDataRate(dr)
	if err != nil {
		return errors.Wrap(err, "get data-rate error")
	}

	switch dataRate.Modulation {
	case band.LoRaModulation:
		txInfo.Modulation = common.Modulation_LORA
		txInfo.ModulationInfo = &gw.DownlinkTXInfo_LoraModulationInfo{
			LoraModulationInfo: &gw.LoRaModulationInfo{
				SpreadingFactor:       uint32(dataRate.SpreadFactor),
				Bandwidth:             uint32(dataRate.Bandwidth),
				CodeRate:              defaultCodeRate,
				PolarizationInversion: true,
			},
		}
	case band.FSKModulation:
		txInfo.Modulation = common.Modulation_FSK
		txInfo.ModulationInfo = &gw.DownlinkTXInfo_FskModulationInfo{
			FskModulationInfo: &gw.FSKModulationInfo{
				Bitrate:   uint32(dataRate.BitRate),
				Bandwidth: uint32(dataRate.Bandwidth),
			},
		}
	default:
		return fmt.Errorf("unknown modulation: %s", dataRate.Modulation)
	}

	return nil
}
587358
func (s *AuthenticationResultType) SetNewDeviceMetadata(v *NewDeviceMetadataType) *AuthenticationResultType {
	s.NewDeviceMetadata = v
	return s
}
431934
func (s *MetricAlarm) SetTreatMissingData(v string) *MetricAlarm {
	s.TreatMissingData = &v
	return s
}
113160
func (p *peerConnection) SetNodeDataIdle(delivered int) {
	p.setIdle(p.stateStarted, delivered, &p.stateThroughput, &p.stateIdle)
}
515586
func (s *Row) SetData(v []*Datum) *Row {
	s.Data = v
	return s
}
1204108
func (s *server) fetchNodeAdvertisedAddr(pub *btcec.PublicKey) (net.Addr, error) {
	node, err := s.chanDB.ChannelGraph().FetchLightningNode(pub)
	if err != nil {
		return nil, err
	}

	if len(node.Addresses) == 0 {
		return nil, errors.New("no advertised addresses found")
	}

	return node.Addresses[0], nil
}
344397
func (s *UnsubscribeFromDatasetInput) SetDatasetName(v string) *UnsubscribeFromDatasetInput {
	s.DatasetName = &v
	return s
}