diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/config.h ircd-hybrid-6.0/include/config.h
--- ircd-hybrid-6.0.orig/include/config.h	Mon Jun  4 01:35:17 2001
+++ ircd-hybrid-6.0/include/config.h	Mon Jun  4 01:33:49 2001
@@ -1140,6 +1140,12 @@
 #define MIN_IDLETIME 1800
 #endif
 
+/* MAX_MAP_NODES - maximum number of nodes for /MAP command
+ *  if there actual nodes than this, then command returns
+ *  without MAP results.
+ */
+#define MAX_MAP_DEPTH 30
+
 #define CONFIG_H_LEVEL_6
 
 #endif /* INCLUDED_config_h */
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/m_commands.h ircd-hybrid-6.0/include/m_commands.h
--- ircd-hybrid-6.0.orig/include/m_commands.h	Mon Jun  4 01:35:17 2001
+++ ircd-hybrid-6.0/include/m_commands.h	Mon Jun  4 01:33:49 2001
@@ -64,6 +64,7 @@
 extern int m_server(struct Client *,struct Client *,int,char **);
 extern int m_user(struct Client *,struct Client *,int, char **);
 extern int m_links(struct Client *,struct Client *,int,char **);
+extern int m_map(struct Client *,struct Client *,int,char **);
 extern int m_summon(struct Client *,struct Client *,int,char **);
 extern int m_stats(struct Client *,struct Client *,int,char **);
 extern int m_users(struct Client *,struct Client *,int,char **);
@@ -116,5 +117,6 @@
 #endif /* USE_SERVICES */
 
 extern int m_silence(struct Client *, struct Client *, int, char**);
+extern int m_map(struct Client *, struct Client *, int, char *[]);
 
 #endif /* INCLUDED_m_commands_h */
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/msg.h ircd-hybrid-6.0/include/msg.h
--- ircd-hybrid-6.0.orig/include/msg.h	Mon Jun  4 01:35:17 2001
+++ ircd-hybrid-6.0/include/msg.h	Mon Jun  4 01:33:49 2001
@@ -77,6 +77,7 @@
 #define MSG_KILL     "KILL"     /* KILL */
 #define MSG_INFO     "INFO"     /* INFO */
 #define MSG_LINKS    "LINKS"    /* LINK */
+#define MSG_MAP      "MAP"      /* MAP */
 #define MSG_STATS    "STATS"    /* STAT */
 #define MSG_USERS    "USERS"    /* USER -> USRS */
 #define MSG_HELP     "HELP"     /* HELP */
@@ -250,6 +251,7 @@
   { MSG_VERSION, m_version,  0, MAXPARA, 1, 0, 0, 0L },
   { MSG_STATS,   m_stats,    0, MAXPARA, 1, 0, 0, 0L },
   { MSG_LINKS,   m_links,    0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_MAP,     m_map,      0, MAXPARA, 1, 0, 0, 0L },
   { MSG_ADMIN,   m_admin,    0, MAXPARA, 1, 1, 0, 0L },
   { MSG_USERS,   m_users,    0, MAXPARA, 1, 0, 0, 0L },
   { MSG_HELP,    m_help,     0, MAXPARA, 1, 0, 0, 0L },
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/numeric.h ircd-hybrid-6.0/include/numeric.h
--- ircd-hybrid-6.0.orig/include/numeric.h	Mon Jun  4 01:35:17 2001
+++ ircd-hybrid-6.0/include/numeric.h	Mon Jun  4 01:33:49 2001
@@ -276,6 +276,9 @@
 #define RPL_MOTDSTART        375
 #define RPL_ENDOFMOTD        376
 
+#define RPL_MAP              377
+#define RPL_ENDOFMAP         378
+
 #define RPL_YOUREOPER        381
 #define RPL_REHASHING        382
 #define RPL_MYPORTIS         384
@@ -360,6 +363,8 @@
 #define ERR_LAST_ERR_MSG     504
 
 #define ERR_SILELISTFULL     511
+
+#define ERR_MAXMAPNODES      512
 
 #define ERR_BLOCKING_NOTID   505
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/Makefile.in ircd-hybrid-6.0/src/Makefile.in
--- ircd-hybrid-6.0.orig/src/Makefile.in	Mon Jun  4 01:35:16 2001
+++ ircd-hybrid-6.0/src/Makefile.in	Mon Jun  4 01:33:49 2001
@@ -104,6 +104,7 @@
 	scache.c \
 	send.c \
 	sprintf_irc.c \
+	m_map.c \
 	whowas.c
 
 #
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/m_map.c ircd-hybrid-6.0/src/m_map.c
--- ircd-hybrid-6.0.orig/src/m_map.c	Thu Jan  1 01:00:00 1970
+++ ircd-hybrid-6.0/src/m_map.c	Mon Jun  4 01:33:49 2001
@@ -0,0 +1,114 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, src/m_map.c
+ *   This file is copyright (C) 2001 Andrew Suffield
+ *                                    <asuffield@users.sourceforge.net>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include "client.h"
+#include "ircd.h"   /* GlobalClientList */
+#include "common.h" /* TRUE bleah */
+#include "numeric.h"
+#include "irc_string.h"
+#include "send.h"
+#include "s_log.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+/* static int map_is_hub(struct Client *acptr) */
+/* { */
+/*   return !(strlen(acptr->name) < 6  */
+/* 	   || (!strcmp(".quiet", (acptr->name)+(strlen(acptr->name)-6)))  */
+/* 	   || (!strcmp(".local", (acptr->name)+(strlen(acptr->name)-6)))); */
+ 
+/* } */
+
+static char header[(MAX_MAP_DEPTH*2) + 4 + 1];
+static int header_length;
+
+static void map_send_server(struct Client* sptr, char* sender_prefix, struct Client* current)
+{
+  struct Client* acptr;
+
+  if (!current->serv)
+    return; /* this should never happen, but let's be safe... */
+
+  /* header should be formatted for us already */
+  sendto_one(sptr, form_str(RPL_MAP), me.name, sender_prefix, header, current->name);
+
+  /* Now, iterate over it's children */
+  if (current->serv->servers)
+    {
+      /* Is this a child? */
+      if (header_length > 0)
+	{
+	  /* OK, was our parent a tail? */
+	  if (header[header_length - 2] == '`')
+	    /* Yes, remove that from the string, it's no longer needed */
+	    header[header_length - 2] = ' ';
+	  /* Regardless, remove the - from it's current position */
+	  header[header_length - 1] = ' ';
+	}
+      /* Add the marker for "more children" */
+      strcat(header, "|-");
+      header_length += 2;
+      for (acptr = current->serv->servers; acptr->lnext; acptr = acptr->lnext) /* Break one hop early to get tail right */
+	{
+	  /* Some of these calls might eat this, add it back */
+	  header[header_length - 1] = '-';
+	  map_send_server(sptr, sender_prefix, acptr);
+	}
+      /* Convert | to ` in this one, it's my last child */
+      header[header_length - 2] = '`';
+      map_send_server(sptr, sender_prefix, acptr);
+      /* Remove the trailing "  " from the string now */
+      header[header_length - 2] = '\0';
+      header_length -= 2;
+    }
+}
+
+int m_map(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
+{
+  static time_t   last_used = 0;
+
+  if(!IsAnOper(sptr))
+    {
+      /* reject non local requests */
+      if(!MyClient(sptr))
+        return 0;
+
+      if((last_used + PACE_WAIT) > CurrentTime)
+        {
+          /* safe enough to give this on a local connect only */
+          sendto_one(sptr,form_str(RPL_LOAD2HI),me.name,parv[0]);
+          return 0;
+        }
+      else
+        {
+          last_used = CurrentTime;
+        }
+    }
+
+  header_length = 0;
+  header[0] = '\0';
+  map_send_server(sptr, parv[0], &me);
+  sendto_one(sptr,form_str(RPL_ENDOFMAP),me.name,parv[0]);
+
+  return 0;
+}
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/messages.tab ircd-hybrid-6.0/src/messages.tab
--- ircd-hybrid-6.0.orig/src/messages.tab	Mon Jun  4 01:35:17 2001
+++ ircd-hybrid-6.0/src/messages.tab	Mon Jun  4 01:33:49 2001
@@ -416,8 +416,8 @@
 /* 374 RPL_ENDOFINFO, */        ":%s 374 %s :End of /INFO list.",
 /* 375 RPL_MOTDSTART, */        ":%s 375 %s :- %s Message of the Day - ",
 /* 376 RPL_ENDOFMOTD, */        ":%s 376 %s :End of /MOTD command.",
-/* 377 */       (char *)NULL,
-/* 378 */       (char *)NULL,
+/* 377 RPL_MAP, */              ":%s 377 %s %s%s",
+/* 378 RPL_ENDOFMAP */          ":%s 378 %s :End of /MAP list.",
 /* 379 */       (char *)NULL,
 /* 380 */       (char *)NULL,
 /* 381 RPL_YOUREOPER, */        ":%s 381 %s :You have entered... the Twilight Zone!.",
@@ -554,7 +554,8 @@
 /* 508 */       (char *)NULL,
 /* 509 */       (char *)NULL,
 /* 510 */       (char *)NULL,
-/* 511 ERR_SILELISTFULL, */ ":%s 511 %s :Your silence list is full"
+/* 511 ERR_SILELISTFULL, */ ":%s 511 %s :Your silence list is full" ,
+/* 512 ERR_MAXMAPNODES */  ":%s 512 %s :Maximum nodes for /MAP"
 };
 
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/messages_cust.tab ircd-hybrid-6.0/src/messages_cust.tab
--- ircd-hybrid-6.0.orig/src/messages_cust.tab	Mon Jun  4 01:35:17 2001
+++ ircd-hybrid-6.0/src/messages_cust.tab	Mon Jun  4 01:33:49 2001
@@ -417,8 +417,8 @@
 /* 374 RPL_ENDOFINFO, */        ":%s 374 %s :End of /INFO list.",
 /* 375 RPL_MOTDSTART, */        ":%s 375 %s :- %s Message of the Day - ",
 /* 376 RPL_ENDOFMOTD, */        ":%s 376 %s :End of /MOTD command.",
-/* 377 */       (char *)NULL,
-/* 378 */       (char *)NULL,
+/* 377 RPL_MAP, */              ":%s 377 %s %s%s",
+/* 378 RPL_ENDOFMAP */          ":%s 378 %s :End of /MAP list.",
 /* 379 */       (char *)NULL,
 /* 380 */       (char *)NULL,
 /* 381 RPL_YOUREOPER, */        ":%s 381 %s :You are now a deity -- be nice or else!",
@@ -555,7 +555,8 @@
 /* 508 */       (char *)NULL,
 /* 509 */       (char *)NULL,
 /* 510 */       (char *)NULL,
-/* 511 ERR_SILELISTFULL, */ ":%s 511 %s :Your silence list is full" 
+/* 511 ERR_SILELISTFULL, */ ":%s 511 %s :Your silence list is full" ,
+/* 512 ERR_MAXMAPNODES */  ":%s 512 %s :Maximum nodes for /MAP"
 };
 
 
