+ apply_undline(source_p, cidr);
+}
+
+static void
+me_dline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
+{
+ int tdline_time = atoi(parv[1]);
+ /* Since this is coming over a server link, assume that the originating
+ * server did the relevant permission/sanity checks...
+ */
+
+ if(!IsPerson(source_p))
+ return;
+
+ apply_dline(source_p, parv[2], tdline_time, LOCAL_COPY(parv[3]));
+
+ check_dlines();
+}
+
+static void
+me_undline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
+{
+ if(!IsPerson(source_p))
+ return;
+
+ apply_undline(source_p, parv[1]);
+}
+
+static void
+apply_dline(struct Client *source_p, const char *dlhost, int tdline_time, char *reason)
+{
+ struct ConfItem *aconf;
+ char *oper_reason;
+ struct rb_sockaddr_storage daddr;
+ int t = AF_INET, ty, b;
+ const char *creason;
+
+ ty = parse_netmask_strict(dlhost, &daddr, &b);
+ if(ty != HM_IPV4 && ty != HM_IPV6)
+ {
+ sendto_one(source_p, ":%s NOTICE %s :Invalid D-Line", me.name, source_p->name);
+ return;
+ }
+ if(ty == HM_IPV6)
+ t = AF_INET6;
+ else
+ t = AF_INET;
+
+ /* This means dlines wider than /16 cannot be set remotely */