From 8a533792a4ef07a63461090b93d1225b95cb89c7 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Sat, 29 Nov 2008 16:14:28 +0100 Subject: [PATCH] Rename MAKE-SUBNET-MASK to MAKE-NETMASK and make it obsolete. --- net.sockets/address-arithmetic.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net.sockets/address-arithmetic.lisp b/net.sockets/address-arithmetic.lisp index 12aca35..6e745a7 100644 --- a/net.sockets/address-arithmetic.lisp +++ b/net.sockets/address-arithmetic.lisp @@ -5,7 +5,7 @@ (in-package :net.sockets) -(defun make-subnet-mask (&key cidr class) +(defun make-netmask (&key cidr class) "Create a subnet mask by specifying either its class(:A, :B or :C) or a CIDR suffix(a number between 0 and 32)." (assert (or cidr class) (cidr class) "You must either specify a CIDR or a network class.") @@ -19,13 +19,15 @@ a CIDR suffix(a number between 0 and 32)." (setf (ldb (byte (- 32 cidr) 0) mask) 0) (make-instance 'ipv4-address :name (integer-to-vector mask)))) +(defobsolete make-subnet-mask make-netmask) + (defun ensure-subnet-mask (thing) "If THING is of type IPV4-ADDRESS it is returned as is; if keyword it must be one of :A, :B or :C otherwise it's treated as a CIDR suffix." (etypecase thing (ipv4-address thing) - (unsigned-byte (make-subnet-mask :cidr thing)) - (keyword (make-subnet-mask :class thing)))) + (unsigned-byte (make-netmask :cidr thing)) + (keyword (make-netmask :class thing)))) (defgeneric inet-address-network-portion (address mask) (:documentation "Apply network mask MASK to ADDRESS in order to calculate the -- 2.11.4.GIT