1 //determines which options will be used for sending icmp requests, as well as what options
2 //were set in the returned icmp reply.
4 namespace System.Net.NetworkInformation
6 // Represent the possible ip options used for the icmp packet
7 public class PingOptions
9 const int DontFragmentFlag = 2;
13 internal PingOptions (IPOptions options) {
14 this.ttl = options.ttl;
15 this.dontFragment = ((options.flags & DontFragmentFlag) > 0 ? true : false);
18 public PingOptions (int ttl, bool dontFragment) {
20 throw new ArgumentOutOfRangeException("ttl");
24 this.dontFragment = dontFragment;
27 public PingOptions () {
36 throw new ArgumentOutOfRangeException("value");
38 ttl = value; //useful to discover routes
42 public bool DontFragment {
47 dontFragment = value; //useful for discovering mtu