mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -05:00
syscalls: Add 'arp-network-interface?'.
* guix/build/syscalls.scm (IFF_NOARP): New variable. (arp-network-interface?): New public procedure.
This commit is contained in:
parent
a0dc97a517
commit
5f5499d684
1 changed files with 9 additions and 0 deletions
|
@ -104,6 +104,7 @@ (define-module (guix build syscalls)
|
|||
network-interface-netmask
|
||||
network-interface-running?
|
||||
loopback-network-interface?
|
||||
arp-network-interface?
|
||||
network-interface-address
|
||||
set-network-interface-netmask
|
||||
set-network-interface-up
|
||||
|
@ -1160,6 +1161,7 @@ (define-as-needed IFF_UP #x1) ;Interface is up
|
|||
(define-as-needed IFF_BROADCAST #x2) ;Broadcast address valid.
|
||||
(define-as-needed IFF_LOOPBACK #x8) ;Is a loopback net.
|
||||
(define-as-needed IFF_RUNNING #x40) ;interface RFC2863 OPER_UP
|
||||
(define-as-needed IFF_NOARP #x80) ;ARP disabled or unsupported
|
||||
|
||||
(define IF_NAMESIZE 16) ;maximum interface name size
|
||||
|
||||
|
@ -1341,6 +1343,13 @@ (define (network-interface-running? name)
|
|||
(close-port sock)
|
||||
(not (zero? (logand flags IFF_RUNNING)))))
|
||||
|
||||
(define (arp-network-interface? name)
|
||||
"Return true if NAME supports the Address Resolution Protocol."
|
||||
(let* ((sock (socket SOCK_STREAM AF_INET 0))
|
||||
(flags (network-interface-flags sock name)))
|
||||
(close-port sock)
|
||||
(zero? (logand flags IFF_NOARP))))
|
||||
|
||||
(define-as-needed (set-network-interface-flags socket name flags)
|
||||
"Set the flag of network interface NAME to FLAGS."
|
||||
(let ((req (make-bytevector ifreq-struct-size)))
|
||||
|
|
Loading…
Reference in a new issue