Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. IP/Host baning

IP/Host baning

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structures
7 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    benjamin23
    wrote on last edited by
    #1

    How can i ban a Host or IP address before i do my accept() call ? Can i pool the connection queue ? Now im doing this: accept->check for valid IP->If it's valid(do nothing)else->close the socket. i belive this can be a bit insecure i dont really know. I what to call my checking routine before doing the accept() any ideas ? -- modified at 19:16 Sunday 13th November, 2005

    N S S C 4 Replies Last reply
    0
    • B benjamin23

      How can i ban a Host or IP address before i do my accept() call ? Can i pool the connection queue ? Now im doing this: accept->check for valid IP->If it's valid(do nothing)else->close the socket. i belive this can be a bit insecure i dont really know. I what to call my checking routine before doing the accept() any ideas ? -- modified at 19:16 Sunday 13th November, 2005

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      It would probably be better to do this at the firewall level.

      1 Reply Last reply
      0
      • B benjamin23

        How can i ban a Host or IP address before i do my accept() call ? Can i pool the connection queue ? Now im doing this: accept->check for valid IP->If it's valid(do nothing)else->close the socket. i belive this can be a bit insecure i dont really know. I what to call my checking routine before doing the accept() any ideas ? -- modified at 19:16 Sunday 13th November, 2005

        S Offline
        S Offline
        sunit5
        wrote on last edited by
        #3

        U can go for SSL Socket http://www.codeproject.com/internet/sslsocket.asp

        T 1 Reply Last reply
        0
        • B benjamin23

          How can i ban a Host or IP address before i do my accept() call ? Can i pool the connection queue ? Now im doing this: accept->check for valid IP->If it's valid(do nothing)else->close the socket. i belive this can be a bit insecure i dont really know. I what to call my checking routine before doing the accept() any ideas ? -- modified at 19:16 Sunday 13th November, 2005

          S Offline
          S Offline
          S Douglas
          wrote on last edited by
          #4

          benjamin23 wrote:

          How can i ban a Host or IP address before i do my accept() call ?

          Which class are you using? If you’re using CAsyncSocket then have you looked into over riding OnConnect? I dont have any code handy but there is a chapter in Secure Coding about doing this. (if I remember I will try and look up the santax when I get home)


          DEBUGGING : Removing the needles from the haystack.

          1 Reply Last reply
          0
          • S sunit5

            U can go for SSL Socket http://www.codeproject.com/internet/sslsocket.asp

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            sunit5 wrote:

            ForumVisual C++ Subject:Re: IP/Host baning Sender:sunit5 Date:0:35 14 Nov '05 U can go for SSL Socket

            Bu buddy you have to make he call for Accept() function before checking is this connection coming from valid ip

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV

            1 Reply Last reply
            0
            • B benjamin23

              How can i ban a Host or IP address before i do my accept() call ? Can i pool the connection queue ? Now im doing this: accept->check for valid IP->If it's valid(do nothing)else->close the socket. i belive this can be a bit insecure i dont really know. I what to call my checking routine before doing the accept() any ideas ? -- modified at 19:16 Sunday 13th November, 2005

              C Offline
              C Offline
              cmk
              wrote on last edited by
              #6

              The best you can do at the socket level is use WSAAccept and specify a condition function that will deny the required address'. However, this isn't a perfect solution, read the notes for WSAAccept. There is also other info out there on this, but i can't remember any links. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/wsaaccept_2.asp[^] ...cmk Save the whales - collect the whole set

              B 1 Reply Last reply
              0
              • C cmk

                The best you can do at the socket level is use WSAAccept and specify a condition function that will deny the required address'. However, this isn't a perfect solution, read the notes for WSAAccept. There is also other info out there on this, but i can't remember any links. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/wsaaccept_2.asp[^] ...cmk Save the whales - collect the whole set

                B Offline
                B Offline
                benjamin23
                wrote on last edited by
                #7

                [LPCONDITIONPROC lpfnCondition] Procedure instance address of the optional, application-specified condition function that will make an accept/reject decision based on the caller information passed in as parameters, and optionally create or join a socket group by assigning an appropriate value to the result parameter g of this function. defines a callback its a verry intresting option but not code samples are supplied by MS any ideas ?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups