// GetIAPrefix returns the Identity Association Prefix Option value, as
// described in RFC 3633, Section 10.
//
// Multiple IAPrefix values may be present in a a single DHCP request.
965631
func GetIAPrefix(o dhcp6.Options) ([]*IAPrefix, error) {
	vv, err := o.Get(dhcp6.OptionIAPrefix)
	if err != nil {
		return nil, err
	}

	// Parse each IAPrefix value
	iaPrefix := make([]*IAPrefix, len(vv))
	for i := range vv {
		iaPrefix[i] = &IAPrefix{}
		if err := iaPrefix[i].UnmarshalBinary(vv[i]); err != nil {
			return nil, err
		}
	}

	return iaPrefix, nil
}
1272363
func (h *Handle) KeyPrefix() []string {
	h.Lock()
	defer h.Unlock()
	return []string{h.app}
}
388912
func getPrefix(tree *RegexTree) *Prefix {
	var concatNode *regexNode
	nextChild := 0

	curNode := tree.root

	for {
		switch curNode.t {
		case ntConcatenate:
			if len(curNode.children) > 0 {
				concatNode = curNode
				nextChild = 0
			}

		case ntGreedy, ntCapture:
			curNode = curNode.children[0]
			concatNode = nil
			continue

		case ntOneloop, ntOnelazy:
			if curNode.m > 0 {
				return &Prefix{
					PrefixStr:       repeat(curNode.ch, curNode.m),
					CaseInsensitive: (curNode.options & IgnoreCase) != 0,
				}
			}
			return nil

		case ntOne:
			return &Prefix{
				PrefixStr:       []rune{curNode.ch},
				CaseInsensitive: (curNode.options & IgnoreCase) != 0,
			}

		case ntMulti:
			return &Prefix{
				PrefixStr:       curNode.str,
				CaseInsensitive: (curNode.options & IgnoreCase) != 0,
			}

		case ntBol, ntEol, ntBoundary, ntECMABoundary, ntBeginning, ntStart,
			ntEndZ, ntEnd, ntEmpty, ntRequire, ntPrevent:

		default:
			return nil
		}

		if concatNode == nil || nextChild >= len(concatNode.children) {
			return nil
		}

		curNode = concatNode.children[nextChild]
		nextChild++
	}
}
848741
func parsePrefix(req *http.Request, b *structs.QueryOptions) {
	query := req.URL.Query()
	if prefix := query.Get("prefix"); prefix != "" {
		b.Prefix = prefix
	}
}
1340830
func (l *s3EncObjects) isPrefix(ctx context.Context, bucket, prefix string, fetchOwner bool, startAfter string) bool {
	var continuationToken, delimiter string

	for {
		loi, e := l.s3Objects.ListObjectsV2(ctx, bucket, prefix, continuationToken, delimiter, 1000, fetchOwner, startAfter)
		if e != nil {
			return false
		}
		for _, obj := range loi.Objects {
			if isGWObject(obj.Name) {
				return true
			}
		}

		continuationToken = loi.NextContinuationToken
		if !loi.IsTruncated {
			break
		}
	}
	return false
}
49463
func GetDefaultEPOptsStringWithPrefix(prefix string) string {
	strs := make([]string, 0, len(registeredWorkloads))
	crs := make([]string, 0, len(registeredWorkloads))

	for k := range registeredWorkloads {
		crs = append(crs, string(k))
	}
	sort.Strings(crs)

	for _, cr := range crs {
		v := registeredWorkloads[WorkloadRuntimeType(cr)].getConfig()
		strs = append(strs, fmt.Sprintf("%s%s=%s", prefix, cr, v[EpOpt]))
	}

	return strings.Join(strs, ", ")
}
905106
func (c *CacheMemDB) GetByPrefix(indexName string, indexValues ...interface{}) ([]*Index, error) {
	if !validIndexName(indexName) {
		return nil, fmt.Errorf("invalid index name %q", indexName)
	}

	indexName = indexName + "_prefix"

	// Get all the objects
	iter, err := c.db.Txn(false).Get(tableNameIndexer, indexName, indexValues...)
	if err != nil {
		return nil, err
	}

	var indexes []*Index
	for {
		obj := iter.Next()
		if obj == nil {
			break
		}
		index, ok := obj.(*Index)
		if !ok {
			return nil, fmt.Errorf("failed to cast cached index")
		}

		indexes = append(indexes, index)
	}

	return indexes, nil
}
521363
func (aSpace *addrSpace) KeyPrefix() []string {
	aSpace.Lock()
	defer aSpace.Unlock()
	return []string{dsConfigKey}
}
1054981
func (v *GenerateServiceRequest) GetPackagePrefix() (o string) {
	if v != nil {
		o = v.PackagePrefix
	}
	return
}
162709
func AddPrefix(path string) string {
	if !strings.HasPrefix(path, Prefix) {
		path = Prefix + path
	}
	return path
}
836669
func getPrefixesFromCIDR(cidrs api.CIDRSlice) []*net.IPNet {
	result, _ := ip.ParseCIDRs(cidrs.StringSlice())
	return result
}
159401
func (d *Daemon) GetNodeSuffix() string {
	var ip net.IP

	switch {
	case option.Config.EnableIPv4:
		ip = node.GetExternalIPv4()
	case option.Config.EnableIPv6:
		ip = node.GetIPv6()
	}

	if ip == nil {
		log.Fatal("Node IP not available yet")
	}

	return ip.String()
}
627848
func getSenderPrefix(mvalid chat1.MessageUnboxedValid, conv chat1.ConversationLocal, currentUsername string) (senderPrefix string) {
	if showSenderPrefix(mvalid, conv) {
		sender := mvalid.SenderUsername
		if sender == currentUsername {
			senderPrefix = "You: "
		} else {
			senderPrefix = fmt.Sprintf("%s: ", sender)
		}
	}
	return senderPrefix
}
430709
func valuePrefix(typeName string) string {
	if v, ok := refValueMap[typeName]; ok {
		return v
	}

	return strings.ToLower(typeName)
}
351670
func (c *Client) GetFrameworkByPrefix(frameworks []Framework, prefix string) (*Framework, error) {
	for _, framework := range frameworks {
		if strings.HasPrefix(framework.Name, prefix) {
			return &framework, nil
		}
	}

	return nil, fmt.Errorf("Framework with prefix \"%s\" not found", prefix)
}
797591
func (p *Params) BonusPrefix(v int) *Params {
	if v >= 0 {
		p.bonusPrefix = v
	}
	return p
}
844184
func GetPrefixesFromCIDRSet(rules api.CIDRRuleSlice) []*net.IPNet {
	cidrs := api.ComputeResultantCIDRSet(rules)
	return getPrefixesFromCIDR(cidrs)
}