+# return the differences in nodes between what we currently have and
+# the list proffered. Returns two refs one to a list of nodes to remove and
+# the other a list of nodes to add
+#
+# input is a list of callsigns (not refs)
+sub diff_nodes
+{
+ my $self = shift;
+ my $in = ref $_[0] ? shift : \@_;
+ my %del = map {($_, 1)} nodes($self);
+ my %in = map {($_, 1)} @$in;
+
+ # remove all the calls that are in both lists
+ for (@$in) {
+ delete $in{$_} if delete $del{$_};
+ }
+ return ([keys %del], [keys %in]);
+}
+
+# same as above but for users
+sub diff_users
+{
+ my $self = shift;
+ my $in = ref $_[0] ? shift : \@_;
+ my %del = map {($_, 1)} users($self);
+ my %in = map {($_, 1)} @$in;
+
+ # remove all the calls that are in both lists
+ for (@$in) {
+ delete $in{$_} if delete $del{$_};
+ }
+ return ([keys %del], [keys %in]);
+}