|
this.stats_perf_counter_array=new System.Diagnostics.PerformanceCounter[10]
{
new System.Diagnostics.PerformanceCounter( "TCPv4","Segments Received/sec"),
new System.Diagnostics.PerformanceCounter( "TCPv4","Segments Sent/sec"),
new System.Diagnostics.PerformanceCounter( "IPv4","Datagrams Received/sec"),
new System.Diagnostics.PerformanceCounter( "IPv4","Datagrams Sent/sec"),
new System.Diagnostics.PerformanceCounter( "UDPv4","Datagrams Received/sec"),
new System.Diagnostics.PerformanceCounter( "UDPv4","Datagrams Sent/sec"),
new System.Diagnostics.PerformanceCounter( "ICMP","Messages Received/sec"),
new System.Diagnostics.PerformanceCounter( "ICMP","Messages Sent/sec"),
new System.Diagnostics.PerformanceCounter("Network Interface", "Bytes Received/sec", this.comboBox_stat_interface.Text),
new System.Diagnostics.PerformanceCounter("Network Interface", "Bytes Sent/sec", this.comboBox_stat_interface.Text)
};
|
|
|
|
|
Hello Jacquelin,
I downloaded the VS 2002 code, builded the solution and got the following message: ...'arp_header.cs' could not be opened ('The system cannot find the file specified. ')
Please advise what I'm doing wrong?
Thanks, Roelf
|
|
|
|
|
just remove it from project. Arp can't be forge from windows API (windows just allows to access IP stack). It was a try before a removal. I do appoligize it still in vs2002 source code. Remember the vs 2002 project is no more maintained and still contains severals bugs removed in the 2003 projects.
Best Regards
Jacquelin
|
|
|
|
|
Hello Jacquelin,
I downloaded the VS 2002 code and got the following message:
arp_header.cs' could not be opened ('The system cannot find the file specified. ')
|
|
|
|
|
It could be a stupid question, but how could I display and act on the Routing Windows Table? My application must change Windows' routes, depending on running process. But I can't manage to do that!
I use the FX Beta 2.0...
Thanks for helpin'
|
|
|
|
|
take a look at MSDN SDK
"Routing Protocol Interface Functions"
AddInterface
ConnectClient
DeleteInterface
DisconnectClient
DoUpdateRoutes
GetEventMessage
GetGlobalInfo
GetInterfaceInfo
GetMfeStatus
GetNeighbors
InterfaceStatus
MibCreate
MibDelete
MibGet
MibGetFirst
MibGetNext
MibSet
MibSetTrapInfo
QueryPower
RegisterProtocol
SetGlobalInfo
SetInterfaceInfo
SetPower
StartComplete
StartProtocol
StopProtocol
UnbindInterface
If the routing protocol supports service handling, implement the following function in addition to those listed preceding:
DoUpdateServices
|
|
|
|
|
The problem is that the indicated solution is available only on Windows Servers...
But you put me on solution way, and I manage to find that :
GetIpForwardTable, in the "IP Helper" MSDN SDK Section. But it seems to be really complex to interface it with C# code...
There is non easier solution, directly integrated in the C# FX 2.0?
|
|
|
|
|
Hi all,
I was trying the packet forging method.
But in the line
socket.SendTo(this.encode(),new IPEndPoint(new IPAddress(network_convert.switch_UInt32(this.destination_address)),remote_port));
it is throwing the following exception.
"A blocking operation was interrupted by a call to WSACancelBlockingCall".
Thanks in advance.
|
|
|
|
|
The Socket trys to Blocking the thread by this operations.
If you set Socket.Blocking = false, this exception is thrown.
-- modified at 4:43 Monday 12th June, 2006
|
|
|
|
|
I am trying to write a firewall with packet filtering capability and i found your project very usefull.it helps me a lot to understand how this level of sniffing is possible with C#.
is it possible to block(Filter) Packets with Socket?
|
|
|
|
|
Since you chose the GPL license, does that really mean I'd have to provide the complete source code for any app I make that includes any of the classes you've provided? If so, I really hope this doesn't become a trend here at CodeProject; they'll need a filter to hide articles with GPL code then
|
|
|
|
|
extract of the gpl faq:
"I'd like to incorporate GPL-covered software in my proprietary system. Can I do this?
You cannot incorporate GPL-covered software in a proprietary system. The goal of the GPL is to grant everyone the freedom to copy, redistribute, understand, and modify a program. If you could incorporate GPL-covered software into a non-free system, it would have the effect of making the GPL-covered software non-free too.
A system incorporating a GPL-covered program is an extended version of that program. The GPL says that any extended version of the program must be released under the GPL if it is released at all. This is for two reasons: to make sure that users who get the software get the freedom they should have, and to encourage people to give back improvements that they make.
However, in many cases you can distribute the GPL-covered software alongside your proprietary system. To do this validly, you must make sure that the free and non-free programs communicate at arms length, that they are not combined in a way that would make them effectively a single program.
The difference between this and "incorporating" the GPL-covered software is partly a matter of substance and partly form. The substantive part is this: if the two programs are combined so that they become effectively two parts of one program, then you can't treat them as two separate programs. So the GPL has to cover the whole thing.
If the two programs remain well separated, like the compiler and the kernel, or like an editor and a shell, then you can treat them as two separate programs--but you have to do it properly. The issue is simply one of form: how you describe what you are doing. Why do we care about this? Because we want to make sure the users clearly understand the free status of the GPL-covered software in the collection.
If people were to distribute GPL-covered software calling it "part of" a system that users know is partly proprietary, users might be uncertain of their rights regarding the GPL-covered software. But if they know that what they have received is a free program plus another program, side by side, their rights will be clear."
You're quite fun: you like to download sources made by others but don't want to share your one...
|
|
|
|
|
I have no qualms about sharing any changes/additions to original classes, but you're also forcing every program that uses these classes to be open-source; a large part of CodeProject's audience are commercial programmers. Could you consider changing to a difference license? You're needlessly preventing a large part of the programmer population from benefiting from your work
|
|
|
|
|
"a large part of CodeProject's audience are commercial programmers"
that means you selling code written by other people... that's why I put my code in GPL sorry for you
|
|
|
|
|
Sorry for most CodeProject people...
All I'd like is to use the udp.Socket_Server class in a freeware program, without having to release the complete source code for the entire program. GPL certainly has its uses, but for entire programs; not for a simple class or two that make lives of hobbyist (or commercial) programmers easier
|
|
|
|
|
I agree. The LGPL would have been a far more appropriate license for this code. Hopefully the author will reconsider using LGPL as it still allows updates to HIS code to be re-released to the public without us having to release our entire products of which his code may only contribute a small piece to.
|
|
|
|
|
Hi,
there is also LGPL - this is perfect for releasing classes which are part of libraries.
Pickig up the ideas and doing some sort of reverse engineering might be the problem you
are faced with.
Personally I do only use lgpl copyrighted code, not being confronted with legal stuff.
|
|
|
|
|
No, it's got nothing to do with stealing code. I head up two open source projects that are released under the Apache License. They're free. Because of GPL licensing, though, I can't use any GPL code in my free projects. Would you claim that the Apache projects aren't in the spirit of open-source?
Most Code Project visitors work for companies that have internal applications. They don't sell these applications - they're purely to support their business. GPL code requires that you release your code for all...something that causes problems when you're dealing with intellectual property issues.
I'd strongly recommend publishing it under the LGPL or something more flexible like the BSD, MIT or Apache licenses.
I'd like it if Code Project didn't allow GPL code, since it's too restrictive.
|
|
|
|
|
I agree GPL is a poor choice for a CP article. Thanks for pointing that out before I downloaded it, I wish CP would require license disclosure in the article.
-- modified at 11:34 Monday 24th July, 2006
|
|
|
|
|
I have been trying to build a port scanner just to learn a bit more about tcp/ip and socket programming. I came across your code and it helped me speed up my development.
The problem I am having is that when I try and create a TCP connection to a remote client using either your tcp_header class or mine, when I send the SYN flag I get back a SYN flag. However, when looking at the data through something like Ethereal I can see that in fact a SYN/ACK is sent back. What could I be doing wrong??
Thanks.
|
|
|
|
|
Hi,
I've not get this trouble now.
Have you the same result using the Network Stuff project with the packet
forging interface and packet capture interface ?
Or either the tcp connection helper in the packet forge ?
I'have try it on several different computers without any troubles.
Did you still get this trouble ?
Best regards
|
|
|
|
|
I have not taken a walk through this latest update of your source code, simply for the fact that it appears that you have decided to break every formatting rule of .NET coding standards.
How, you are able to continue coding in the older C style, is well beyond me. I really feel strongly about how difficult it is to read code that doesn't adhere to either Camel or Pascal casing.
Camel casing is quite popular among Java developers, where the method names are always first word lower, subsequent words being proper cased.
Camel casing sample...
startUsingCamelCasing(bool goodIdeaOrNot);
Where as Pascal casing proper cases all words in method and property names. Pascal casing is found throughout the .NET BCL (base class libraries), and imho IS much easier to read than all other coding standards.
Pascal casing sample...
PleaseUsePascalCasing(bool betterIdeaAccordingToMe);
To provide reasons besides shear bias, for my arguments. With older C style coding, where everything is lower cased, and underscores are used to separate words in methods or types, it's nearly impossible to discern the different between a variable, method, or a type! At least in Camel or Pascal casing the Type's are proper cased so that it's easy to identify classes and structs quickly over variables.
Not to mention some sort of scoping standards, like using m_ or _ to prefix class scoped variables. Large projects, and complicated code are bad enough without making everyone guess as to the scope of a variable, or even whether it's a variable and not a type or method!
If you would change your formatting to more closely follow either of these coding standards, I believe you would receive better feedback from your viewers. Many may be like me, and see strange formatting and simply walk away.
Please consider my suggestions, I in no way consider you a bad programmer because of your formatting, but you should adapt to standards that are popular to help your viewers and fellow programmers.
Only those who attempt the absurd, can achieve the impossible.
|
|
|
|
|
Sorry, I realize that I did not provide you with any decent resources to help aim you in the right direction, should you so choose to look into my suggestions.
Here's link that will provide you with best practice guidelines for naming conventions and a host of other coding topics. Whether you agree with my thoughts or not, this will help you to understand my perspective.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnamingguidelines.asp
Ps. I dig your efforts, and I gave you 5 regardless of not reading your update. I have read your code in the past, and you demonstrated a good working knowledge of a host of networking topics. And, simply because I love all efforts in network programming! Keep coding! This thread is merely a suggestion on formatting, not a flame!
Only those who attempt the absurd, can achieve the impossible.
|
|
|
|
|
Thanks for link, I'll look at it, but I'm not sure to follow all the rules in the futur Programming rules are changing quite often, and are not the same for all the languages and for all companies, so is one the best ?
|
|
|
|
|
yes, the coding style should follow foxcop suggests
Regards,
unruledboy@hotmail.com
|
|
|
|