83 lines
3.7 KiB
Text
83 lines
3.7 KiB
Text
// Code generated by cmd/cgo; DO NOT EDIT.
|
|
|
|
//line /usr/lib/go-1.22/src/net/cgo_unix_cgo.go:1:1
|
|
// Copyright 2022 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build cgo && !netgo && unix && !darwin
|
|
|
|
package net
|
|
|
|
/*
|
|
#define _GNU_SOURCE
|
|
|
|
#cgo CFLAGS: -fno-stack-protector
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
#include <netdb.h>
|
|
#include <unistd.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
#ifndef EAI_NODATA
|
|
#define EAI_NODATA -5
|
|
#endif
|
|
|
|
// If nothing else defined EAI_OVERFLOW, make sure it has a value.
|
|
#ifndef EAI_OVERFLOW
|
|
#define EAI_OVERFLOW -12
|
|
#endif
|
|
*/
|
|
import _ "unsafe"
|
|
import "unsafe"
|
|
|
|
const (
|
|
_C_AF_INET = ( /*line :34:20*/_Ciconst_AF_INET /*line :34:28*/)
|
|
_C_AF_INET6 = ( /*line :35:20*/_Ciconst_AF_INET6 /*line :35:29*/)
|
|
_C_AF_UNSPEC = ( /*line :36:20*/_Ciconst_AF_UNSPEC /*line :36:30*/)
|
|
_C_EAI_AGAIN = ( /*line :37:20*/_Ciconst_EAI_AGAIN /*line :37:30*/)
|
|
_C_EAI_NODATA = ( /*line :38:20*/_Ciconst_EAI_NODATA /*line :38:31*/)
|
|
_C_EAI_NONAME = ( /*line :39:20*/_Ciconst_EAI_NONAME /*line :39:31*/)
|
|
_C_EAI_SERVICE = ( /*line :40:20*/_Ciconst_EAI_SERVICE /*line :40:32*/)
|
|
_C_EAI_OVERFLOW = ( /*line :41:20*/_Ciconst_EAI_OVERFLOW /*line :41:33*/)
|
|
_C_EAI_SYSTEM = ( /*line :42:20*/_Ciconst_EAI_SYSTEM /*line :42:31*/)
|
|
_C_IPPROTO_TCP = ( /*line :43:20*/_Ciconst_IPPROTO_TCP /*line :43:32*/)
|
|
_C_IPPROTO_UDP = ( /*line :44:20*/_Ciconst_IPPROTO_UDP /*line :44:32*/)
|
|
_C_SOCK_DGRAM = ( /*line :45:20*/_Ciconst_SOCK_DGRAM /*line :45:31*/)
|
|
_C_SOCK_STREAM = ( /*line :46:20*/_Ciconst_SOCK_STREAM /*line :46:32*/)
|
|
)
|
|
|
|
type (
|
|
_C_char = /*line :50:23*/_Ctype_char /*line :50:29*/
|
|
_C_uchar = /*line :51:23*/_Ctype_uchar /*line :51:30*/
|
|
_C_int = /*line :52:23*/_Ctype_int /*line :52:28*/
|
|
_C_uint = /*line :53:23*/_Ctype_uint /*line :53:29*/
|
|
_C_socklen_t = /*line :54:23*/_Ctype_socklen_t /*line :54:34*/
|
|
_C_struct_addrinfo = /*line :55:23*/_Ctype_struct_addrinfo /*line :55:40*/
|
|
_C_struct_sockaddr = /*line :56:23*/_Ctype_struct_sockaddr /*line :56:40*/
|
|
)
|
|
|
|
func _C_malloc(n uintptr) unsafe.Pointer { return ( /*line :59:51*/_Cfunc__CMalloc /*line :59:58*/)( /*line :59:60*/_Ctype_size_t /*line :59:68*/(n)) }
|
|
func _C_free(p unsafe.Pointer) { func() { _cgo0 := /*line :60:51*/p; _cgoCheckPointer(_cgo0, nil); /*line :60:53*/_Cfunc_free(_cgo0); }() }
|
|
|
|
func _C_ai_addr(ai *_C_struct_addrinfo) **_C_struct_sockaddr { return &ai.ai_addr }
|
|
func _C_ai_family(ai *_C_struct_addrinfo) *_C_int { return &ai.ai_family }
|
|
func _C_ai_flags(ai *_C_struct_addrinfo) *_C_int { return &ai.ai_flags }
|
|
func _C_ai_next(ai *_C_struct_addrinfo) **_C_struct_addrinfo { return &ai.ai_next }
|
|
func _C_ai_protocol(ai *_C_struct_addrinfo) *_C_int { return &ai.ai_protocol }
|
|
func _C_ai_socktype(ai *_C_struct_addrinfo) *_C_int { return &ai.ai_socktype }
|
|
|
|
func _C_freeaddrinfo(ai *_C_struct_addrinfo) {
|
|
func() { _cgo0 := /*line :70:17*/ai; _cgoCheckPointer(_cgo0, nil); /*line :70:20*/_Cfunc_freeaddrinfo(_cgo0); }()
|
|
}
|
|
|
|
func _C_gai_strerror(eai _C_int) string {
|
|
return ( /*line :74:9*/_Cfunc_GoString /*line :74:18*/)(( /*line :74:20*/_Cfunc_gai_strerror /*line :74:33*/)(eai))
|
|
}
|
|
|
|
func _C_getaddrinfo(hostname, servname *_C_char, hints *_C_struct_addrinfo, res **_C_struct_addrinfo) (int, error) {
|
|
x, err := func() (_Ctype_int, error){ var _cgo0 *_Ctype_char = /*line :78:26*/hostname; var _cgo1 *_Ctype_char = /*line :78:36*/servname; _cgo2 := /*line :78:46*/hints; _cgo3 := /*line :78:53*/res; _cgoCheckPointer(_cgo2, nil); _cgoCheckPointer(_cgo3, nil); return /*line :78:57*/_C2func_getaddrinfo(_cgo0, _cgo1, _cgo2, _cgo3); }()
|
|
return int(x), err
|
|
}
|