![]() |
|
|
|
|
|||||||
| IP Networking Questions involving TCP/IP, Routers, Hubs, Network protocols, etc go here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to know port is block.. | Saurabh78 | IP Networking | 2 | 05-15-2008 07:51 AM |
| disabled telnet now need port 23 or port 22 | panzerkw | SUN Solaris | 3 | 03-05-2007 11:08 AM |
| BAD SUPER BLOCK - Run fsck with alternate super block number | admin wanabee | HP-UX | 1 | 09-08-2006 10:57 AM |
| unix program that can port scan a c block of ips for proxies | user | UNIX for Dummies Questions & Answers | 1 | 07-11-2005 11:01 AM |
| block telnet to specific port | xiamin | IP Networking | 5 | 03-20-2002 04:51 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
How to block a port
Hi,
i faced a problem, where i have to block a port, therefore nobody used it, evenwith SO_REUSEADDR flag. How can i achive it. |
| Forum Sponsor | ||
|
|
|
|||
|
Without knowing any more - consider using a firewall.
If a port is "busy" you cannot bump the user off the port unless you kill the process that has the socket to the port open. Then you open the port and block it. It sounds like you want some kind of firewall rather than a simple C program. |
|
|||
|
Well, the simplest way to achieve something like this (for *nix) is to link your app with libwrap: libwrap - Wikipedia, the free encyclopedia and then bundle tcpwrappers + a sample hosts.allow and hosts.deny with your product.
I'm sure windows has similar api functionality for their packet filter. Alternatively you can come up with an internal packet filter for the application based on a configuration file, parser and logic that you devise. It's very simple in theory...An ip based ruleset is created via flat file, xml, etc.., then on a client connect the ruleset is parsed, the client address is compared for exclusion. If exclusion is indicated the connection is closed with no further processing except, perhaps, for a log notice, otherwise the client is serviced. Last edited by ramen_noodle; 05-15-2008 at 08:06 AM. |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|