on *:CONNECT:{
;; network specific
set $+(%, $network, ., somevar) example
;; connection specific
set $+(%, $cid, ., somvar) example2
}
on *:DISCONNECT:{
;; unset network specific variables
unset $+(%, $network, ., *)
;; unset connection specific variables
unset $+(%, $cid, ., *)
}