// Retrieve Whether or not there is a firewall associated with this gateway.
541015
func (r Network_Gateway) GetNetworkFirewallFlag() (resp bool, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Gateway", "getNetworkFirewallFlag", nil, &r.Options, &resp)
	return
}
1370125
func (n *NetworkServerAPI) GetGateway(ctx context.Context, req *ns.GetGatewayRequest) (*ns.GetGatewayResponse, error) {
	var id lorawan.EUI64
	copy(id[:], req.Id)

	gw, err := storage.GetGateway(storage.DB(), id)
	if err != nil {
		return nil, errToRPCError(err)
	}

	resp := ns.GetGatewayResponse{
		Gateway: &ns.Gateway{
			Id: gw.GatewayID[:],
			Location: &common.Location{
				Latitude:  gw.Location.Latitude,
				Longitude: gw.Location.Longitude,
				Altitude:  gw.Altitude,
			},
		},
	}

	resp.CreatedAt, _ = ptypes.TimestampProto(gw.CreatedAt)
	resp.UpdatedAt, _ = ptypes.TimestampProto(gw.UpdatedAt)

	if gw.GatewayProfileID != nil {
		resp.Gateway.GatewayProfileId = gw.GatewayProfileID.Bytes()
	}

	if gw.FirstSeenAt != nil {
		resp.FirstSeenAt, _ = ptypes.TimestampProto(*gw.FirstSeenAt)
	}

	if gw.LastSeenAt != nil {
		resp.LastSeenAt, _ = ptypes.TimestampProto(*gw.LastSeenAt)
	}

	for i := range gw.Boards {
		var gwBoard ns.GatewayBoard
		if gw.Boards[i].FPGAID != nil {
			gwBoard.FpgaId = gw.Boards[i].FPGAID[:]
		}

		if gw.Boards[i].FineTimestampKey != nil {
			gwBoard.FineTimestampKey = gw.Boards[i].FineTimestampKey[:]
		}

		resp.Gateway.Boards = append(resp.Gateway.Boards, &gwBoard)
	}

	return &resp, nil
}
854274
func (a *NetAddr) IsEmpty() bool {
	return a.Addr == "" && a.AddrNetwork == "" && a.Path == ""
}
90375
func (client *lockRESTClient) isHostUp() bool {
	client.lockSync.Lock()
	defer client.lockSync.Unlock()

	if client.connected {
		return true
	}
	select {
	case <-client.timer.C:
		client.connected = true
		client.timer = nil
		return true
	default:
	}
	return false
}
194308
func (r Network_Gateway_Vlan) Bypass() (err error) {
	var resp datatypes.Void
	err = r.Session.DoRequest("SoftLayer_Network_Gateway_Vlan", "bypass", nil, &r.Options, &resp)
	return
}
840026
func (nc *Conn) IsReconnecting() bool {
	nc.mu.RLock()
	defer nc.mu.RUnlock()
	return nc.isReconnecting()
}
421466
func (r Network_Security_Scanner_Request) GetRequestorOwnedFlag() (resp bool, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Security_Scanner_Request", "getRequestorOwnedFlag", nil, &r.Options, &resp)
	return
}
297540
func isConnError(err error) bool {
	if err == io.EOF {
		return true
	}
	estr := err.Error()
	return strings.Contains(estr, "broken pipe") ||
		strings.Contains(estr, "connection reset") ||
		strings.Contains(estr, "connection refused") ||
		strings.Contains(estr, "connection pool is closed")
}
13859
func (api *API) GetFirewallPolicy(fp_id string) (*FirewallPolicy, error) {
	result := new(FirewallPolicy)
	url := createUrl(api, firewallPolicyPathSegment, fp_id)
	err := api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}
	result.api = api
	return result, nil

}
377212
func ruleExists(rules []cloudapi.FirewallRule, rule string) (bool, string) {
	for _, r := range rules {
		if strings.EqualFold(r.Rule, rule) {
			return true, r.Id
		}
	}

	return false, ""
}
386270
func (api *API) FirewallRule(zoneID, firewallRuleID string) (FirewallRule, error) {
	uri := fmt.Sprintf("/zones/%s/firewall/rules/%s", zoneID, firewallRuleID)

	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return FirewallRule{}, errors.Wrap(err, errMakeRequestError)
	}

	var firewallRuleResponse FirewallRuleResponse
	err = json.Unmarshal(res, &firewallRuleResponse)
	if err != nil {
		return FirewallRule{}, errors.Wrap(err, errUnmarshalError)
	}

	return firewallRuleResponse.Result, nil
}
502726
func (s *Server) checkAuthentication(c *client) bool {
	switch c.kind {
	case CLIENT:
		return s.isClientAuthorized(c)
	case ROUTER:
		return s.isRouterAuthorized(c)
	case GATEWAY:
		return s.isGatewayAuthorized(c)
	case LEAF:
		return s.isLeafNodeAuthorized(c)
	default:
		return false
	}
}
416817
func (md *MDServerRemote) IsConnected() bool {
	conn := md.getConn()
	return conn != nil && conn.IsConnected()
}
51697
func (h *AuthHandlers) isProxy() bool {
	if h.Component == teleport.ComponentProxy {
		return true
	}
	return false
}
116330
func (s *ChainService) IsBanned(addr string) bool {
	replyChan := make(chan bool, 1)

	select {
	case s.query <- banQueryMsg{
		addr:  addr,
		reply: replyChan,
	}:
		return <-replyChan
	case <-s.quit:
		return false
	}
}
1147060
func (fw *firewall) isBlocked(remoteAddr string) bool {
	fw.blockListMutex.Lock()

	// Check if the remote address exists in the blocked map
	_, exists := fw.blockList[remoteAddr]

	fw.blockListMutex.Unlock()
	return exists
}
1007377
func IsConnectionReset(err error) bool {
	if urlErr, ok := err.(*url.Error); ok {
		err = urlErr.Err
	}
	if opErr, ok := err.(*net.OpError); ok {
		err = opErr.Err
	}
	if osErr, ok := err.(*os.SyscallError); ok {
		err = osErr.Err
	}
	if errno, ok := err.(syscall.Errno); ok && errno == syscall.ECONNRESET {
		return true
	}
	return false
}