示例#1
0
            /// <summary>
            ///     Finds the first field in the packet of the specified type.
            /// </summary>
            /// <returns>
            ///     The first field in the packet of the specified type, or <c>null</c> if there is no field of the specified type.
            /// </returns>
            /// <param name='type'>
            ///     The type of packet to find.
            /// </param>
            public PpiField FindFirstByType(PpiFieldType type)
            {
                var ppiFields = this.PpiFields;

                foreach (var r in ppiFields)
                {
                    if (r.FieldType == type)
                    {
                        return(r);
                    }
                }
                return(null);
            }
 /// <summary>
 /// Finds the fields in the packet of the specified type.
 /// </summary>
 /// <returns>
 /// The fields of the specified type, or an empty array of there are no fields of that type.
 /// </returns>
 /// <param name='type'>
 /// The type of packet to find.
 /// </param>
 public PpiField[] FindByType(PpiFieldType type)
 {
     return PpiFields.FindAll(p => (p.FieldType == type)).ToArray();
 }
 /// <summary>
 /// Finds the first field in the packet of the specified type.
 /// </summary>
 /// <returns>
 /// The first field in the packet of the specified type, or <c>null</c> if there is no field of the specified type.
 /// </returns>
 /// <param name='type'>
 /// The type of packet to find.
 /// </param>
 public PpiField FindFirstByType (PpiFieldType type)
 {
     var ppiFields = this.PpiFields;
     foreach (var r in ppiFields)
     {
         if (r.FieldType == type)
             return r;
     }
     return null;
 }
 /// <summary>
 /// Checks whether there is field of the specified type in the packet.
 /// </summary>
 /// <param name='type'>
 /// <c>true</c> if there is a field of the specified type in the packet, <c>false</c> if not.
 /// </param>
 public bool Contains(PpiFieldType type)
 {
     return (PpiFields.Find(field => field.FieldType == type) != null);
 }
 /// <summary>
 /// Removes all fields of the specified type.
 /// </summary>
 /// <param name='type'>
 /// the field type to be removed.
 /// </param>
 public void RemoveAll(PpiFieldType type)
 {
     PpiFields.RemoveAll( field => type == field.FieldType);
 }
示例#6
0
 /// <summary>
 ///     Finds the fields in the packet of the specified type.
 /// </summary>
 /// <returns>
 ///     The fields of the specified type, or an empty array of there are no fields of that type.
 /// </returns>
 /// <param name='type'>
 ///     The type of packet to find.
 /// </param>
 public PpiField[] FindByType(PpiFieldType type)
 {
     return(this.PpiFields.FindAll(p => (p.FieldType == type)).ToArray());
 }
示例#7
0
 /// <summary>
 ///     Checks whether there is field of the specified type in the packet.
 /// </summary>
 /// <param name='type'>
 ///     <c>true</c> if there is a field of the specified type in the packet, <c>false</c> if not.
 /// </param>
 public bool Contains(PpiFieldType type)
 {
     return(this.PpiFields.Find(field => field.FieldType == type) != null);
 }
示例#8
0
 /// <summary>
 ///     Removes all fields of the specified type.
 /// </summary>
 /// <param name='type'>
 ///     the field type to be removed.
 /// </param>
 public void RemoveAll(PpiFieldType type)
 {
     this.PpiFields.RemoveAll(field => type == field.FieldType);
 }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PacketDotNet.Ieee80211.PpiUnknown"/> class.
 /// </summary>
 /// <param name='typeNumber'>
 /// The PPI field type number.
 /// </param>
 /// <param name='UnknownBytes'>
 /// The field data.
 /// </param>
 public PpiUnknown (int typeNumber, byte[] UnknownBytes)
 {
     fieldType = (PpiFieldType)typeNumber;
     this.UnknownBytes = UnknownBytes;
 }
示例#10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PacketDotNet.Ieee80211.PpiUnknown"/> class.
 /// </summary>
 /// <param name='typeNumber'>
 /// The PPI field type number.
 /// </param>
 public PpiUnknown (int typeNumber)
 {
     fieldType = (PpiFieldType)typeNumber;
 }
示例#11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PacketDotNet.Ieee80211.PpiUnknown"/> class from the 
 /// provided stream.
 /// </summary>
 /// <remarks>
 /// The position of the BinaryReader's underlying stream will be advanced to the end
 /// of the PPI field.
 /// </remarks>
 /// <param name='typeNumber'>
 /// The PPI field type number
 /// </param>
 /// <param name='br'>
 /// The stream the field will be read from
 /// </param>
 /// <param name='length'>
 /// The number of bytes the unknown field contains.
 /// </param>
 public PpiUnknown (int typeNumber, BinaryReader br, int length)
 {
     fieldType = (PpiFieldType) typeNumber;
     UnknownBytes = br.ReadBytes(length);
 }