// API check on required nf_conntrack* modules (nf_conntrack, nf_conntrack_netlink)
771279
func checkNfSocket() error {
	fd, err := syscall.Socket(syscall.AF_NETLINK, syscall.SOCK_RAW, syscall.NETLINK_NETFILTER)
	if err != nil {
		return err
	}
	syscall.Close(fd)
	return nil
}
1184978
func main() {
	opts := CliOptions{}
	_, err := flags.Parse(&opts)
	if err != nil {
		log.Fatal(err)
	}
	err = config.LoadDotEnvFirst(opts.EnvFile, os.Getenv("ENV_PATH"), "./.env")
	if err != nil {
		log.Fatal(err)
	}
	rcCfg, err := NewRingCentralConfigEnv()
	if err != nil {
		log.Fatal(err)
	}

	fmtutil.PrintJSON(opts)
	fmtutil.PrintJSON(rcCfg)

	apiClient, err := ru.NewApiClientPassword(
		rcCfg.ApplicationCredentials(),
		rcCfg.PasswordCredentials())
	if err != nil {
		log.Fatal(err)
	}

	httpClient := apiClient.HTTPClient()

	if 1 == 0 {
		sendFaxRaw(opts, httpClient)
	}

	if 1 == 1 {
		fmt.Println(opts.Files[0])

		file, err := os.Open(opts.Files[0])
		if err != nil {
			log.Fatal(err)
		}

		params := rc.SendFaxMessageOpts{}
		if len(opts.CoverPageText) > 0 {
			//params.FaxResolution = optional.NewString("High")
			params.CoverPageText = optional.NewString(opts.CoverPageText)
		}
		fmtutil.PrintJSON(opts)
		if 1 == 1 {
			params.Attachment = optional.NewInterface(file)
		}
		info, resp, err := apiClient.MessagesApi.SendFaxMessage(
			context.Background(),
			"~",
			"~",
			opts.To,
			&params)

		if err != nil {
			panic(err)
		} else if resp.StatusCode > 299 {
			panic(fmt.Errorf("API Status %v", resp.StatusCode))
		}
		fmtutil.PrintJSON(info)
	}

	fmt.Println("DONE")
}
694084
func (s *NetworkACLService) GetNetworkACLListID(name string, opts ...OptionFunc) (string, int, error) {
	p := &ListNetworkACLListsParams{}
	p.p = make(map[string]interface{})

	p.p["name"] = name

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return "", -1, err
		}
	}

	l, err := s.ListNetworkACLLists(p)
	if err != nil {
		return "", -1, err
	}

	if l.Count == 0 {
		return "", l.Count, fmt.Errorf("No match found for %s: %+v", name, l)
	}

	if l.Count == 1 {
		return l.NetworkACLLists[0].Id, l.Count, nil
	}

	if l.Count > 1 {
		for _, v := range l.NetworkACLLists {
			if v.Name == name {
				return v.Id, l.Count, nil
			}
		}
	}
	return "", l.Count, fmt.Errorf("Could not find an exact match for %s: %+v", name, l)
}
1108240
func main() {
	// this has no real purpose besides making the import present in this main package.
	// without this line the meta info for the swagger doc wouldn't be discovered
	petstore.APIVersion = Version

	// This servers na hypothetical API
	if err := rest.ServeAPI(); err != nil {
		log.Fatal(err)
	}
}
1219035
func NewCrossModelRelationsAPI(
	st CrossModelRelationsState,
	fw firewall.State,
	resources facade.Resources,
	authorizer facade.Authorizer,
	authCtxt *commoncrossmodel.AuthContext,
	egressAddressWatcher egressAddressWatcherFunc,
	relationStatusWatcher relationStatusWatcherFunc,
	offerStatusWatcher offerStatusWatcherFunc,
) (*CrossModelRelationsAPI, error) {
	return &CrossModelRelationsAPI{
		st:                    st,
		fw:                    fw,
		resources:             resources,
		authorizer:            authorizer,
		authCtxt:              authCtxt,
		egressAddressWatcher:  egressAddressWatcher,
		relationStatusWatcher: relationStatusWatcher,
		offerStatusWatcher:    offerStatusWatcher,
		relationToOffer:       make(map[string]string),
	}, nil
}
1055878
func (c ConfigClient) CheckAPIServerOutOfDateWarning(ctx context.Context) (res OutOfDateInfo, err error) {
	err = c.Cli.Call(ctx, "keybase.1.config.checkAPIServerOutOfDateWarning", []interface{}{CheckAPIServerOutOfDateWarningArg{}}, &res)
	return
}
734054
func loadKernelModules(context *model.NodeupModelContext) error {
	err := modprobe("br_netfilter")
	if err != nil {
		// TODO: Return error in 1.11 (too risky for 1.10)
		glog.Warningf("error loading br_netfilter module: %v", err)
	}
	// TODO: Add to /etc/modules-load.d/ ?
	return nil
}
1273270
func (o *VSP) NetconfManagers(info *bambou.FetchingInfo) (NetconfManagersList, *bambou.Error) {

	var list NetconfManagersList
	err := bambou.CurrentSession().FetchChildren(o, NetconfManagerIdentity, &list, info)
	return list, err
}
1022249
func (v *GenerateServiceRequest) GetModules() (o map[ModuleID]*Module) {
	if v != nil {
		o = v.Modules
	}
	return
}
1363991
func (h *Handle) SupportsNetlinkFamily(nlFamily int) bool {
	_, ok := h.sockets[nlFamily]
	return ok
}
41159
func (obj *Global) IsValidConnectionStringRaw(ctx context.Context, connection interface{}) (bool, error) {
	result := &struct {
		Return bool	`json:"qReturn"`
	} {}
	err := obj.rpc(ctx, "IsValidConnectionString", result, ensureEncodable(connection))
	return result.Return, err 
}
793883
func (e *Endpoint) ConntrackName() string {
	if e.ConntrackLocalLocked() {
		return fmt.Sprintf("%05d", int(e.ID))
	}
	return "global"
}
611399
func (o *ObjectConstraint) Required(l ...string) *ObjectConstraint {
	o.reqlock.Lock()
	defer o.reqlock.Unlock()

	for _, pname := range l {
		o.required[pname] = struct{}{}
	}
	return o
}
237415
func (api *NFSAPI) GetNFSPlans() (*sacloud.NFSPlans, error) {
	notes, err := api.client.Note.Reset().Find()
	if err != nil {
		return nil, err
	}
	for _, note := range notes.Notes {
		if note.Class == sacloud.ENoteClass("json") && note.Name == "sys-nfs" {
			rawPlans := note.Content

			var plans struct {
				Plans *sacloud.NFSPlans `json:"plans"`
			}

			err := json.Unmarshal([]byte(rawPlans), &plans)
			if err != nil {
				return nil, err
			}

			return plans.Plans, nil
		}
	}

	return nil, nil
}
603871
func getApi() (uint, error) {
	api := C.seccomp_api_get()
	if api == 0 {
		return 0, fmt.Errorf("API level operations are not supported")
	}

	return uint(api), nil
}
870979
func (obj *Global) IsValidConnectionString(ctx context.Context, connection *Connection) (bool, error) {
	result := &struct {
		Return bool	`json:"qReturn"`
	} {}
	err := obj.rpc(ctx, "IsValidConnectionString", result, connection)
	return result.Return, err 
}
305914
func Module(mod ModuleFunc) func(*Runner) error {
	return func(r *Runner) error {
		switch mod := mod.(type) {
		case ModuleExec:
			if mod == nil {
				mod = DefaultExec
			}
			r.Exec = mod
		case ModuleOpen:
			if mod == nil {
				mod = DefaultOpen
			}
			r.Open = mod
		default:
			return fmt.Errorf("unknown module type: %T", mod)
		}
		return nil
	}
}