Skip to content

Instantly share code, notes, and snippets.

@paulzhol
Created August 8, 2017 10:37
Show Gist options
  • Save paulzhol/c6d54dc2baf2a6bd204b343a15459661 to your computer and use it in GitHub Desktop.
Save paulzhol/c6d54dc2baf2a6bd204b343a15459661 to your computer and use it in GitHub Desktop.
generate errors_freebsd_arm.go on armv6 FreeBSD-11.1-RELEASE
// +build ignore
package unix
// copied from mkerrors.sh
/*
#include <sys/capability.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/event.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_types.h>
#include <net/route.h>
#include <netinet/in.h>
#include <termios.h>
#include <netinet/ip.h>
#include <netinet/ip_mroute.h>
#include <sys/extattr.h>
#if __FreeBSD__ >= 10
#define IFT_CARP 0xf8 // IFT_CARP is deprecated in FreeBSD 10
#undef SIOCAIFADDR
#define SIOCAIFADDR _IOW(105, 26, struct oifaliasreq) // ifaliasreq contains if_data
#undef SIOCSIFPHYADDR
#define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq contains if_data
#endif
*/
import "C"
// These were extracted by running:
// git diff -w zerrors_freebsd_arm.go | awk -s '/^-/ && $0 ~ /=/ {printf("%s = C.%s\n", $2, $2);}'
// Then later cleaning up:
// - commented out entries marked with *WS* were manually removed as they are still appear in zerrors_freebsd_arm.go,
// just the indentation changed.
// - commented out entries were manually removed because cgo -godefs failed to find them.
const (
//*WS* BIOCGRTIMEOUT = C.BIOCGRTIMEOUT
//*WS* BIOCSRTIMEOUT = C.BIOCSRTIMEOUT
//DLT_HHDLC = C.DLT_HHDLC
//*WS* DLT_MATCHING_MAX = C.DLT_MATCHING_MAX
//*WS* DLT_PPP_BSDOS = C.DLT_PPP_BSDOS
//*WS* DLT_SLIP_BSDOS = C.DLT_SLIP_BSDOS
//*WS* EVFILT_SYSCOUNT = C.EVFILT_SYSCOUNT
//*WS* IFF_CANTCHANGE = C.IFF_CANTCHANGE
//IFF_SMART = C.IFF_SMART
IFT_1822 = C.IFT_1822
IFT_A12MPPSWITCH = C.IFT_A12MPPSWITCH
IFT_AAL2 = C.IFT_AAL2
IFT_AAL5 = C.IFT_AAL5
IFT_ADSL = C.IFT_ADSL
IFT_AFLANE8023 = C.IFT_AFLANE8023
IFT_AFLANE8025 = C.IFT_AFLANE8025
IFT_ARAP = C.IFT_ARAP
IFT_ARCNET = C.IFT_ARCNET
IFT_ARCNETPLUS = C.IFT_ARCNETPLUS
IFT_ASYNC = C.IFT_ASYNC
IFT_ATM = C.IFT_ATM
IFT_ATMDXI = C.IFT_ATMDXI
IFT_ATMFUNI = C.IFT_ATMFUNI
IFT_ATMIMA = C.IFT_ATMIMA
IFT_ATMLOGICAL = C.IFT_ATMLOGICAL
IFT_ATMRADIO = C.IFT_ATMRADIO
IFT_ATMSUBINTERFACE = C.IFT_ATMSUBINTERFACE
IFT_ATMVCIENDPT = C.IFT_ATMVCIENDPT
IFT_ATMVIRTUAL = C.IFT_ATMVIRTUAL
IFT_BGPPOLICYACCOUNTING = C.IFT_BGPPOLICYACCOUNTING
IFT_BSC = C.IFT_BSC
IFT_CCTEMUL = C.IFT_CCTEMUL
IFT_CEPT = C.IFT_CEPT
IFT_CES = C.IFT_CES
IFT_CHANNEL = C.IFT_CHANNEL
IFT_CNR = C.IFT_CNR
IFT_COFFEE = C.IFT_COFFEE
IFT_COMPOSITELINK = C.IFT_COMPOSITELINK
IFT_DCN = C.IFT_DCN
IFT_DIGITALPOWERLINE = C.IFT_DIGITALPOWERLINE
IFT_DIGITALWRAPPEROVERHEADCHANNEL = C.IFT_DIGITALWRAPPEROVERHEADCHANNEL
IFT_DLSW = C.IFT_DLSW
IFT_DOCSCABLEDOWNSTREAM = C.IFT_DOCSCABLEDOWNSTREAM
IFT_DOCSCABLEMACLAYER = C.IFT_DOCSCABLEMACLAYER
IFT_DOCSCABLEUPSTREAM = C.IFT_DOCSCABLEUPSTREAM
IFT_DS0 = C.IFT_DS0
IFT_DS0BUNDLE = C.IFT_DS0BUNDLE
IFT_DS1FDL = C.IFT_DS1FDL
IFT_DS3 = C.IFT_DS3
IFT_DTM = C.IFT_DTM
IFT_DVBASILN = C.IFT_DVBASILN
IFT_DVBASIOUT = C.IFT_DVBASIOUT
IFT_DVBRCCDOWNSTREAM = C.IFT_DVBRCCDOWNSTREAM
IFT_DVBRCCMACLAYER = C.IFT_DVBRCCMACLAYER
IFT_DVBRCCUPSTREAM = C.IFT_DVBRCCUPSTREAM
IFT_ENC = C.IFT_ENC
IFT_EON = C.IFT_EON
IFT_EPLRS = C.IFT_EPLRS
IFT_ESCON = C.IFT_ESCON
IFT_ETHER = C.IFT_ETHER
//IFT_FAITH = C.IFT_FAITH
IFT_FAST = C.IFT_FAST
IFT_FASTETHER = C.IFT_FASTETHER
IFT_FASTETHERFX = C.IFT_FASTETHERFX
IFT_FDDI = C.IFT_FDDI
IFT_FIBRECHANNEL = C.IFT_FIBRECHANNEL
IFT_FRAMERELAYINTERCONNECT = C.IFT_FRAMERELAYINTERCONNECT
IFT_FRAMERELAYMPI = C.IFT_FRAMERELAYMPI
IFT_FRDLCIENDPT = C.IFT_FRDLCIENDPT
IFT_FRELAY = C.IFT_FRELAY
IFT_FRELAYDCE = C.IFT_FRELAYDCE
IFT_FRF16MFRBUNDLE = C.IFT_FRF16MFRBUNDLE
IFT_FRFORWARD = C.IFT_FRFORWARD
IFT_G703AT2MB = C.IFT_G703AT2MB
IFT_G703AT64K = C.IFT_G703AT64K
IFT_GIF = C.IFT_GIF
IFT_GIGABITETHERNET = C.IFT_GIGABITETHERNET
IFT_GR303IDT = C.IFT_GR303IDT
IFT_GR303RDT = C.IFT_GR303RDT
IFT_H323GATEKEEPER = C.IFT_H323GATEKEEPER
IFT_H323PROXY = C.IFT_H323PROXY
IFT_HDH1822 = C.IFT_HDH1822
IFT_HDLC = C.IFT_HDLC
IFT_HDSL2 = C.IFT_HDSL2
IFT_HIPERLAN2 = C.IFT_HIPERLAN2
IFT_HIPPI = C.IFT_HIPPI
IFT_HIPPIINTERFACE = C.IFT_HIPPIINTERFACE
IFT_HOSTPAD = C.IFT_HOSTPAD
IFT_HSSI = C.IFT_HSSI
IFT_HY = C.IFT_HY
IFT_IBM370PARCHAN = C.IFT_IBM370PARCHAN
IFT_IDSL = C.IFT_IDSL
IFT_IEEE80211 = C.IFT_IEEE80211
IFT_IEEE80212 = C.IFT_IEEE80212
IFT_IEEE8023ADLAG = C.IFT_IEEE8023ADLAG
IFT_IFGSN = C.IFT_IFGSN
IFT_IMT = C.IFT_IMT
IFT_INTERLEAVE = C.IFT_INTERLEAVE
IFT_IP = C.IFT_IP
IFT_IPFORWARD = C.IFT_IPFORWARD
IFT_IPOVERATM = C.IFT_IPOVERATM
IFT_IPOVERCDLC = C.IFT_IPOVERCDLC
IFT_IPOVERCLAW = C.IFT_IPOVERCLAW
IFT_IPSWITCH = C.IFT_IPSWITCH
//IFT_IPXIP = C.IFT_IPXIP
IFT_ISDN = C.IFT_ISDN
IFT_ISDNBASIC = C.IFT_ISDNBASIC
IFT_ISDNPRIMARY = C.IFT_ISDNPRIMARY
IFT_ISDNS = C.IFT_ISDNS
IFT_ISDNU = C.IFT_ISDNU
IFT_ISO88022LLC = C.IFT_ISO88022LLC
IFT_ISO88023 = C.IFT_ISO88023
IFT_ISO88024 = C.IFT_ISO88024
IFT_ISO88025 = C.IFT_ISO88025
IFT_ISO88025CRFPINT = C.IFT_ISO88025CRFPINT
IFT_ISO88025DTR = C.IFT_ISO88025DTR
IFT_ISO88025FIBER = C.IFT_ISO88025FIBER
IFT_ISO88026 = C.IFT_ISO88026
IFT_ISUP = C.IFT_ISUP
IFT_L3IPXVLAN = C.IFT_L3IPXVLAN
IFT_LAPB = C.IFT_LAPB
IFT_LAPD = C.IFT_LAPD
IFT_LAPF = C.IFT_LAPF
IFT_LOCALTALK = C.IFT_LOCALTALK
IFT_LOOP = C.IFT_LOOP
IFT_MEDIAMAILOVERIP = C.IFT_MEDIAMAILOVERIP
IFT_MFSIGLINK = C.IFT_MFSIGLINK
IFT_MIOX25 = C.IFT_MIOX25
IFT_MODEM = C.IFT_MODEM
IFT_MPC = C.IFT_MPC
IFT_MPLS = C.IFT_MPLS
IFT_MPLSTUNNEL = C.IFT_MPLSTUNNEL
IFT_MSDSL = C.IFT_MSDSL
IFT_MVL = C.IFT_MVL
IFT_MYRINET = C.IFT_MYRINET
IFT_NFAS = C.IFT_NFAS
IFT_NSIP = C.IFT_NSIP
IFT_OPTICALCHANNEL = C.IFT_OPTICALCHANNEL
IFT_OPTICALTRANSPORT = C.IFT_OPTICALTRANSPORT
IFT_OTHER = C.IFT_OTHER
IFT_P10 = C.IFT_P10
IFT_P80 = C.IFT_P80
IFT_PARA = C.IFT_PARA
IFT_PFLOG = C.IFT_PFLOG
IFT_PFSYNC = C.IFT_PFSYNC
IFT_PLC = C.IFT_PLC
IFT_POS = C.IFT_POS
IFT_PPPMULTILINKBUNDLE = C.IFT_PPPMULTILINKBUNDLE
IFT_PROPBWAP2MP = C.IFT_PROPBWAP2MP
IFT_PROPCNLS = C.IFT_PROPCNLS
IFT_PROPDOCSWIRELESSDOWNSTREAM = C.IFT_PROPDOCSWIRELESSDOWNSTREAM
IFT_PROPDOCSWIRELESSMACLAYER = C.IFT_PROPDOCSWIRELESSMACLAYER
IFT_PROPDOCSWIRELESSUPSTREAM = C.IFT_PROPDOCSWIRELESSUPSTREAM
IFT_PROPMUX = C.IFT_PROPMUX
IFT_PROPWIRELESSP2P = C.IFT_PROPWIRELESSP2P
IFT_PTPSERIAL = C.IFT_PTPSERIAL
IFT_PVC = C.IFT_PVC
IFT_QLLC = C.IFT_QLLC
IFT_RADIOMAC = C.IFT_RADIOMAC
IFT_RADSL = C.IFT_RADSL
IFT_REACHDSL = C.IFT_REACHDSL
IFT_RFC1483 = C.IFT_RFC1483
IFT_RS232 = C.IFT_RS232
IFT_RSRB = C.IFT_RSRB
IFT_SDLC = C.IFT_SDLC
IFT_SDSL = C.IFT_SDSL
IFT_SHDSL = C.IFT_SHDSL
IFT_SIP = C.IFT_SIP
IFT_SLIP = C.IFT_SLIP
IFT_SMDSDXI = C.IFT_SMDSDXI
IFT_SMDSICIP = C.IFT_SMDSICIP
IFT_SONET = C.IFT_SONET
IFT_SONETOVERHEADCHANNEL = C.IFT_SONETOVERHEADCHANNEL
IFT_SONETPATH = C.IFT_SONETPATH
IFT_SONETVT = C.IFT_SONETVT
IFT_SRP = C.IFT_SRP
IFT_SS7SIGLINK = C.IFT_SS7SIGLINK
IFT_STACKTOSTACK = C.IFT_STACKTOSTACK
IFT_STARLAN = C.IFT_STARLAN
IFT_STF = C.IFT_STF
IFT_T1 = C.IFT_T1
IFT_TDLC = C.IFT_TDLC
IFT_TERMPAD = C.IFT_TERMPAD
IFT_TR008 = C.IFT_TR008
IFT_TRANSPHDLC = C.IFT_TRANSPHDLC
IFT_TUNNEL = C.IFT_TUNNEL
IFT_ULTRA = C.IFT_ULTRA
IFT_USB = C.IFT_USB
IFT_V11 = C.IFT_V11
IFT_V35 = C.IFT_V35
IFT_V36 = C.IFT_V36
IFT_V37 = C.IFT_V37
IFT_VDSL = C.IFT_VDSL
IFT_VIRTUALIPADDRESS = C.IFT_VIRTUALIPADDRESS
IFT_VOICEEM = C.IFT_VOICEEM
IFT_VOICEENCAP = C.IFT_VOICEENCAP
IFT_VOICEFXO = C.IFT_VOICEFXO
IFT_VOICEFXS = C.IFT_VOICEFXS
IFT_VOICEOVERATM = C.IFT_VOICEOVERATM
IFT_VOICEOVERFRAMERELAY = C.IFT_VOICEOVERFRAMERELAY
IFT_VOICEOVERIP = C.IFT_VOICEOVERIP
IFT_X213 = C.IFT_X213
IFT_X25 = C.IFT_X25
IFT_X25DDN = C.IFT_X25DDN
IFT_X25HUNTGROUP = C.IFT_X25HUNTGROUP
IFT_X25MLP = C.IFT_X25MLP
IFT_X25PLE = C.IFT_X25PLE
IFT_XETHER = C.IFT_XETHER
//IPPROTO_MAXID = C.IPPROTO_MAXID
//IPV6_FAITH = C.IPV6_FAITH
//IP_FAITH = C.IP_FAITH
//MAP_NORESERVE = C.MAP_NORESERVE
//MAP_RENAME = C.MAP_RENAME
//NET_RT_MAXID = C.NET_RT_MAXID
//RTF_PRCLONING = C.RTF_PRCLONING
//RTM_OLDADD = C.RTM_OLDADD
//RTM_OLDDEL = C.RTM_OLDDEL
//SIOCADDRT = C.SIOCADDRT
//SIOCALIFADDR = C.SIOCALIFADDR
//SIOCDELRT = C.SIOCDELRT
//SIOCDLIFADDR = C.SIOCDLIFADDR
//SIOCGLIFADDR = C.SIOCGLIFADDR
//SIOCGLIFPHYADDR = C.SIOCGLIFPHYADDR
//SIOCSLIFPHYADDR = C.SIOCSLIFPHYADDR
//*WS* TIOCTIMESTAMP = C.TIOCTIMESTAMP
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment