Esempio n. 1
0
 /// <summary>
 /// Gets the <see cref="RadioTapField" /> with the specified type, or null if the
 /// field is not in the packet.
 /// </summary>
 /// <param name='type'>
 /// Radio Tap field type
 /// </param>
 public RadioTapField this[RadioTapType type]
 {
     get
     {
         RadioTapFields.TryGetValue(type, out var field);
         return(field);
     }
 }
Esempio n. 2
0
            /// <summary>
            /// Removes a field of the specified type if one is present in the packet.
            /// </summary>
            /// <param name='fieldType'>
            /// Field type.
            /// </param>
            public void Remove(RadioTapType fieldType)
            {
                RadioTapField field;

                if (RadioTapFields.TryGetValue(fieldType, out field))
                {
                    RadioTapFields.Remove(fieldType);
                    Length -= field.Length;
                    var presenceBit   = (int)field.FieldType;
                    var presenceField = (presenceBit / 32);
                    Present[presenceField] &= (UInt32) ~(1 << presenceBit);
                }
            }
Esempio n. 3
0
 /// <summary>
 /// Checks for the presence of a field of the specified type in the packet.
 /// </summary>
 /// <param name='fieldType'>
 /// The field type to check for.
 /// </param>
 /// <returns><c>true</c> if the packet contains a field of the specified type; otherwise, <c>false</c>.</returns>
 public bool Contains(RadioTapType fieldType)
 {
     return(RadioTapFields.ContainsKey(fieldType));
 }