summaryrefslogtreecommitdiff
path: root/include/socket.h
AgeCommit message (Collapse)Author
2012-10-12Windows: In-depth cleanup (see details)ChrisTX
-Fix x64 builds for Windows. Now all configurations compile. -Remove the non-working rebase stuff. -Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now. -Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2 -Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need. -Enable optimizations for release builds. -De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure -Add the VC++ specific bad files in .gitignore -Disable PID writing on Windows. This is only making sense for *nix builds. -Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working) -Removed certain unused functions and variables -Remove stdint defines from the windows wrapper -Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds. -Re-evaluated the warnings list, commented it. -Moved inspircd_config/_version to include/ to match *nix -Removed the creation of inspircd_se_config, as it isn't used at all. -Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out) -Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly. -Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down) -Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded. -Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways) -Removed the unused ClearConsole() -Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate. -Made inet_aton an inline function for increased performance -C4800, performance warning about bool forcing, resolved at all occurrences. -C4701, uninitialized variable 'cached', resolved at all occurrences. -dlerror() was migrated out of the wrapper for more thread safety (no global buffer being shared) and increased performance. -Removed the wrong CRT debug flags. This drains a lot of performance. -Removed the clock_gettime/gettimeofday wrappers -Replaced all TCHAR/ANSI mix-ups of functions with the correct respective function. -Added a block of C4355 for < VS2012 -Update project files for c870714
2012-09-12Fix bug #291 - fix rehashing bind tags not changing them between ↵Adam
servers/clients and ssl/nonssl
2012-07-05Fix Doxygen syntax errors.Peter Powell
2012-04-19Replace copyright headers with headers granting specific authors copyrightRobby-
2010-04-26Define comparator for irc::sockets::sockaddrsDaniel De Graaf
This only compares IP/port, which ignores IPv6 flow information and scope ID, which aren't important in testing for equality.
2010-01-21Remove unneeded save of errnodanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12309 e03df62e-2008-0410-955e-edbf42e46eb7
2010-01-11...because every now and again, i have to do a massive commit.brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
2009-11-13Get rid of socklen_t parameter to Bind, we are using C++ here and can do it ↵danieldg
other ways git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12129 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-24Get rid of OpenTCPSocketdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11969 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-24Create irc::sockets::cidr_maskdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11968 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-24Move forward declarations to typedefs.hdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11967 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-22Make ConfigTag::items privatedanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11956 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-22Make irc::sockets::* parameters consistent, add irc::sockets::maskdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11953 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-21Kill ListenSocketBase, use OnAcceptConnection for all new connectionsdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11950 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-09Add server ports to ServerInstance->ports, enable SSL on them using OnHookIOdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11810 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-03Get rid of a bunch of memory-wasting C-style stringsdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11796 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-26Remove InspIRCd* parameters and fieldsdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11763 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-21Create StreamSocket for IO hooking implementationdanieldg
Fixes the SSL SendQ bug Removes duplicate code between User and BufferedSocket Simplify SSL module API Simplify EventHandler API (Readable/Writeable moved to SE) Add hook for culled objects to invoke callbacks prior to destructor Replace SocketCull with GlobalCull now that sockets can close themselves Shorten common case of user read/parse/write path: User::Write is now zero-copy up to syscall/SSL invocation User::Read has only two copy/scan passes from read() to ProcessCommand git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-02Fix some ICC-found warnings and remove unused #definedanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11639 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-02Use a set to mark client SSL ports rather than going by textual IP/port pairsdanieldg
This theoretically speeds up accepting connections. Visible changes are proper IPv6 port text in 005 output and no possibility of incorrect SSL on addresses that mismatch an incoming port (possible with IPv4 wildcard SSL and IPv6 plaintext on the same port, not that anyone would do such a thing). Bind ports also now tell which SSL module they use in /stats p. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11629 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-02Add irc::sockets::satouser for user-readable IP/port pairsdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11627 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-01Use a bool return type for boolean returndanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11585 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-01Remove unneeded paramaters from OnAcceptReadydanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11581 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-01Remove now-unused insp_sockaddr and insp_inaddr typesdanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11579 e03df62e-2008-0410-955e-edbf42e46eb7
2009-09-01Remove needless sockaddr[2] allocations, replace with ↵danieldg
irc::sockets::sockaddrs union git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11574 e03df62e-2008-0410-955e-edbf42e46eb7
2009-06-16Fix incorrect attempted inline of irc::sockets::sa_sizedanieldg
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11415 e03df62e-2008-0410-955e-edbf42e46eb7
2009-06-16Fix sockaddr length argument, BSD will complain if it doesn't exactly match ↵danieldg
the expected size git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11414 e03df62e-2008-0410-955e-edbf42e46eb7
2009-05-04Canonicalize bind addresses when creating listen socketsdanieldg
This fixes /stats p output for SSL ports not working if a non-canonical address is used in the configuration (IPv6 with :: or mixed hexadecimal case). This also cleans up some now-useless sockaddr[2] allocations. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11361 e03df62e-2008-0410-955e-edbf42e46eb7
2009-04-29Add IP address conversion utility functions, irc::sockets::aptosa and ↵danieldg
irc::sockets::satoap git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11336 e03df62e-2008-0410-955e-edbf42e46eb7
2009-04-01Correct bind address of ident requests on multihomed IPv6-capable servers.danieldg
Fixes bug #815, reported by Szymek. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11274 e03df62e-2008-0410-955e-edbf42e46eb7
2009-03-15Update all wiki links to point to the new wiki. This was done automatically ↵psychon
with the following command, only .Makefile.inc got some indent fixups by hand. for file in $(find -type f -and -not -path '*/.svn/*' -and -not -name '*.so') ; do sed -e 's#http://www.inspircd.org/wiki#http://wiki.inspircd.org#' -e 's#http://wiki.inspircd.org/index.php/#http://wiki.inspircd.org/#' -i $file ; done git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11223 e03df62e-2008-0410-955e-edbf42e46eb7
2009-01-02Update copyrights for 2009.w00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10932 e03df62e-2008-0410-955e-edbf42e46eb7
2008-09-08Remove crappy, unsafe (and now unneeded!) casts.w00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10476 e03df62e-2008-0410-955e-edbf42e46eb7
2008-09-08Make OnAcceptReady pure virtual, rename ListenSocket to ListenSocketBase, ↵w00t
create ClientListenSocket and inherit from ListenSocketBase to create User objects. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10469 e03df62e-2008-0410-955e-edbf42e46eb7
2008-09-08Add incoming IP to OnAcceptReadyw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10467 e03df62e-2008-0410-955e-edbf42e46eb7
2008-09-07Tidy up some of the internals a bit, making things a bit more extensible and ↵w00t
future proof. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10462 e03df62e-2008-0410-955e-edbf42e46eb7
2008-09-07Start moving IO hooking from being bufferedsocket based to residing in ↵w00t
EventHandler, this will pave the way for a generic listener type, and also simplifies a lot of code. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10447 e03df62e-2008-0410-955e-edbf42e46eb7
2008-06-12for realpippijn
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9898 e03df62e-2008-0410-955e-edbf42e46eb7
2008-05-09Convert CIDR matching and wildcard matching to operate on std::stringsbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9681 e03df62e-2008-0410-955e-edbf42e46eb7
2008-04-07We were lucky this one didnt bring down the whole devnet (see cmd_part.cpp diff)brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9400 e03df62e-2008-0410-955e-edbf42e46eb7
2008-02-03Clear up header insanityw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8808 e03df62e-2008-0410-955e-edbf42e46eb7
2008-01-10Header update: 2007 -> 2008w00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8694 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-15In the grand tradition of huge fucking commits:w00t
- chanrec -> Channel - userrec -> User Enjoy. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8204 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-23Craquity craq De-craq!brain
This is probably broken on windows, do not attempt to use there yet unless you like broken stuff. Cant say for sure as i havent even tried to build yet and most likely wont tonight. --- Abstract most of the berkely socket API out into SocketEngine derived classes. SocketEngine base class implements standard berkely sockets that 'real mens systems' like linux and freebsd have. For socketengine_iocp we implement the windows specific nonesense like the special things needed for udp and accept (ick). All this to eliminate a bunch of ifdefs. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7810 e03df62e-2008-0410-955e-edbf42e46eb7
2007-07-16OOPS! We try again, since I'm smoking craq. LF is 0x0a NOT CR.peavey
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7456 e03df62e-2008-0410-955e-edbf42e46eb7
2007-07-16'svn propset -R svn:eol-style CR *' Set to UNIX-style always. Binaries are ↵peavey
auto skipped by svn. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7454 e03df62e-2008-0410-955e-edbf42e46eb7
2007-06-17Commentsbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7382 e03df62e-2008-0410-955e-edbf42e46eb7
2007-06-14- Made the recvfrom wrapper a bit neater.burlex
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7314 e03df62e-2008-0410-955e-edbf42e46eb7
2007-06-14Some general syntax cleanups.pippijn
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7304 e03df62e-2008-0410-955e-edbf42e46eb7
2007-05-19Windows support. Tested and working to compile on freebsd and linux. Next ↵w00t
step is to make sure it actually works in windows too. ;p. Add Burlex to contributors. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7043 e03df62e-2008-0410-955e-edbf42e46eb7