none
How do you disable ports using C++? RRS feed

  • Question

  • I have a computer that is hooked up to a switch and i need to make a program to disable all of the switch's ports except for one. Then to cycle through the other ports.

    First off, how do you disable ports on the PC using C++ or can you even?

    Second, is it possible to have the program disable ports on the switch without using telnet?

    The Switch is a Netgear ProSafe 24 Port 10/100 Switch (JFS524 Model 23) therefore it is a non-configurable “dummy” switch so it doesn’t have an IP address or DNS name and therefore no username or password either. Help would be great, I have been beating my head around this for almost two days.

    Thanks

    Brandon T

    • Moved by Jesse Jiang Monday, July 26, 2010 6:44 AM third-part product (From:Visual C++ Language)
    Wednesday, July 21, 2010 8:16 PM

All replies

  • Doesn't look promising since that's an unmanaged switch. What does your user guide say?

    Doesn't it make sense to post this question in the Netgear Community forum?

    Wednesday, July 21, 2010 9:28 PM
  • I don't think it belongs there since it is not a Prosecure device nor is it a SOHO device.
    Wednesday, July 21, 2010 9:57 PM
  • Well, I wouldn't let that hold you back from posting. You are more likely to get an answer there than here. Moreover, you can post a question directly to customer support at: https://my.netgear.com/myNETGEAR/support.asp

    You haven't answered my other question.

    Wednesday, July 21, 2010 10:10 PM
  • Brandon T wrote:
    >
    >I have a computer that is hooked up to a switch and i need to make
    >a program to disable all of the switch's ports except for one.
    >Then to cycle through the other ports.
    >
    >First off, how do you disable ports on the PC using C++ or can you even?
     
    Which ports on your PC? The word "ports" is WAY overloaded..
    >Second, is it possible to have the program disable ports on the switch
    >without using telnet?
     
    No. Switches are dumb. Very few are programmable in any way. Even with
    programmable smart routers, you usually cannot manage individual ports.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, DDK MVP
    Friday, July 23, 2010 5:10 AM
  • Sorry the "Ports" that i am looking to disable are the ones of the switch itself. My first question was only to understand how C++ disabled ports on the computer so i could figure out how to disable them on the switch.

     From the sounds of things the only way to disable it is by using Telnet and talking directly to the port. I guess what i need to do now is write a program that runs Putty(Telnet), connects to the switch, and then runs the rest of the code needed to disable and enable ports through Putty.

    I was mainly just hoping that there was a easier way to do it without having to use Putty. If you think of anything else that would help my situation then please send me a message at

    Brandon.Towell@gmail.com

     

    Thanks

    Brandon T

    Friday, July 23, 2010 6:56 PM
  • You can accomplish the Telnet client part using Winsock quite easily. Since Telenet is a text based service, it should be a pretty straight forward thing, once you get the socket bound and make the connection. At home, I have some code for Telnet client and server. I can e-mail that if you want.

    • Edited by jinzai Friday, July 23, 2010 7:21 PM typo
    Friday, July 23, 2010 7:20 PM
  • That would be very helpful.

    Brandon.Towell@gmail.com

     

     

    Friday, July 23, 2010 9:10 PM
  • Brandon T wrote:
    >
    >From the sounds of things the only way to disable it is by using Telnet
    >and talking directly to the port.
     
    Why do you think so? The JFS524 is an inexpensive, unmanaged switch. It
    is not configurable. It does not have an IP address. There is no way to
    talk to it. It does not speak telnet.
     
    >I guess what i need to do now is write a program that runs Putty(Telnet),
    >connects to the switch,...
     
    Have you tried to telnet into the switch by hand? What IP address did you
    use? What did you see when you did?
     
    >I was mainly just hoping that there was a easier way to do it without
    >having to use Putty.
     
    There is no "easier" way. There is no way AT ALL. What you're asking
    cannot be done. The switch cannot be configured.
     
    There certainly are routers that can be configured by HTTP and/or by
    telnet, because routers have an IP address. Hubs and switches do not. They
    are passive devices.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, DDK MVP
    Sunday, July 25, 2010 3:16 AM