- Config->ConfValue(Config->config_data, "bind", "port", count, configToken, MAXBUF);
- Config->ConfValue(Config->config_data, "bind", "address", count, Addr, MAXBUF);
- Config->ConfValue(Config->config_data, "bind", "type", count, Type, MAXBUF);
-
- if ((!*Type) || (!strcmp(Type,"clients")))
- {
- irc::portparser portrange(configToken, false);
- int portno = -1;
- while ((portno = portrange.GetToken()))
- {
- if (*Addr == '*')
- *Addr = 0;
-
- bool skip = false;
- for (std::vector<ListenSocket*>::iterator n = Config->ports.begin(); n != Config->ports.end(); ++n)
- {
- if (((*n)->GetIP() == Addr) && ((*n)->GetPort() == portno))
- {
- skip = true;
- /* XXX: Here, erase from our copy of the list */
- for (std::vector<std::pair<std::string, int> >::iterator k = old_ports.begin(); k != old_ports.end(); ++k)
- {
- if ((k->first == Addr) && (k->second == portno))
- {
- old_ports.erase(k);
- break;
- }
- }
- }
- }
- if (!skip)
- {
- ListenSocket* ll = new ListenSocket(this, portno, Addr);
- if (ll->GetFd() > -1)
- {
- bound++;
- Config->ports.push_back(ll);
- }
- else
- {
- failed_ports.push_back(std::make_pair(Addr, portno));
- }
- ports_found++;
- }
- }
- }
+ case AF_INET:
+ base = (unsigned char*)&sa.in4.sin_addr;
+ len = 4;
+ break;
+
+ case AF_INET6:
+ base = (unsigned char*)&sa.in6.sin6_addr;
+ len = 16;
+ break;
+
+ case AF_UNIX:
+ return sa.un.sun_path;
+
+ default:
+ // If we have reached this point then we have encountered a bug.
+ ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "BUG: irc::sockets::cidr_mask::str(): socket type %d is unknown!", type);
+ return "<unknown>";