[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/06: syscalls: Rename 'network-interfaces' and 'all-network-interfaces
From: |
Ludovic Courtès |
Subject: |
02/06: syscalls: Rename 'network-interfaces' and 'all-network-interfaces'. |
Date: |
Sat, 25 Jul 2015 12:45:08 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit b89e74054ee54b3afc8aed99fe9be89e8e05890b
Author: Ludovic Courtès <address@hidden>
Date: Sat Jul 25 11:46:31 2015 +0200
syscalls: Rename 'network-interfaces' and 'all-network-interfaces'.
* guix/build/syscalls.scm (network-interfaces): Rename to...
(network-interface-names): ... this.
(all-network-interfaces): Rename to...
(all-network-interface-names): ... this.
* gnu/services/networking.scm (dhcp-client-service): Adjust accordingly.
* tests/syscalls.scm ("all-network-interfaces"): Rename to...
("all-network-interface-names"): ... this, and adjust accordingly.
("network-interfaces"): Rename to...
("network-interface-names"): ... this, and adjust accordingly.
---
gnu/services/networking.scm | 2 +-
guix/build/syscalls.scm | 14 +++++++-------
tests/syscalls.scm | 10 +++++-----
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 102202c..c2b4045 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -173,7 +173,7 @@ Protocol (DHCP) client, on all the non-loopback network
interfaces."
(define valid?
(negate loopback-network-interface?))
(define ifaces
- (filter valid? (all-network-interfaces)))
+ (filter valid? (all-network-interface-names)))
;; XXX: Make sure the interfaces are up so that
;; 'dhclient' can actually send/receive over them.
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index b7c0f7e..ae5b2ed 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -60,8 +60,8 @@
IFF_UP
IFF_BROADCAST
IFF_LOOPBACK
- all-network-interfaces
- network-interfaces
+ all-network-interface-names
+ network-interface-names
network-interface-flags
loopback-network-interface?
network-interface-address
@@ -533,8 +533,8 @@ most LEN bytes from BV."
(take-while (negate zero?) bytes)))
result))))))
-(define* (network-interfaces #:optional sock)
- "Return the list of existing network interfaces. This is typically limited
+(define* (network-interface-names #:optional sock)
+ "Return the names of existing network interfaces. This is typically limited
to interfaces that are currently up."
(let* ((close? (not sock))
(sock (or sock (socket SOCK_STREAM AF_INET 0)))
@@ -559,9 +559,9 @@ to interfaces that are currently up."
;; Regexp matching an interface line in Linux's /proc/net/dev.
(make-regexp "^[[:blank:]]*([[:alnum:]]+):.*$"))
-(define (all-network-interfaces)
- "Return all the registered network interfaces, including those that are not
-up."
+(define (all-network-interface-names)
+ "Return all the names of the registered network interfaces, including those
+that are not up."
(call-with-input-file "/proc/net/dev" ;XXX: Linux-specific
(lambda (port)
(let loop ((interfaces '()))
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 6b614a5..3b71cd7 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -152,15 +152,15 @@
(status:exit-val status))))
(eq? #t result))))))))
-(test-assert "all-network-interfaces"
- (match (all-network-interfaces)
+(test-assert "all-network-interface-names"
+ (match (all-network-interface-names)
(((? string? names) ..1)
(member "lo" names))))
-(test-assert "network-interfaces"
- (match (network-interfaces)
+(test-assert "network-interface-names"
+ (match (network-interface-names)
(((? string? names) ..1)
- (lset<= string=? names (all-network-interfaces)))))
+ (lset<= string=? names (all-network-interface-names)))))
(test-assert "network-interface-flags"
(let* ((sock (socket AF_INET SOCK_STREAM 0))
- branch master updated (bd4af2f -> e7f5691), Ludovic Courtès, 2015/07/25
- 01/06: doc: Make "Application Setup" more prominent., Ludovic Courtès, 2015/07/25
- 03/06: syscalls: 'define-c-struct' distinguishes pointers from integers., Ludovic Courtès, 2015/07/25
- 02/06: syscalls: Rename 'network-interfaces' and 'all-network-interfaces'.,
Ludovic Courtès <=
- 04/06: syscalls: 'read-socket-address' gracefully handles unsupported families., Ludovic Courtès, 2015/07/25
- 05/06: syscalls: 'define-c-struct' properly align reads., Ludovic Courtès, 2015/07/25
- 06/06: syscalls: Add 'network-interfaces', which wraps libc's 'getifaddrs'., Ludovic Courtès, 2015/07/25