nicmp6.inc 1018 B

12345678910111213141516171819202122232425262728293031
  1. function ICMP6_FILTER_WILLPASS(__type: Integer; const filterp: TICMP6_Filter): Boolean;
  2. begin
  3. Result := (filterp.data[__type shr 5] and (1 shl (__type and 31))) = 0;
  4. end;
  5. function ICMP6_FILTER_WILLBLOCK(__type: Integer; const filterp: TICMP6_Filter): Boolean;
  6. begin
  7. Result := (filterp.data[__type shr 5] and (1 shl (__type and 31))) <> 0;
  8. end;
  9. procedure ICMP6_FILTER_SETPASS(__type: Integer; var filterp: TICMP6_Filter);
  10. begin
  11. filterp.data[__type shr 5] := filterp.data[__type shr 5] and not
  12. (1 shl (__type and 31));
  13. end;
  14. procedure ICMP6_FILTER_SETBLOCK(__type: Integer; var filterp: TICMP6_Filter);
  15. begin
  16. filterp.data[__type shr 5] := filterp.data[__type shr 5] or
  17. (1 shl (__type and 31));
  18. end;
  19. procedure ICMP6_FILTER_SETPASSALL(var filterp: TICMP6_Filter);
  20. begin
  21. FillChar(filterp, SizeOf(filterp), 0);
  22. end;
  23. procedure ICMP6_FILTER_SETBLOCKALL(var filterp: TICMP6_Filter);
  24. begin
  25. FillChar(filterp, SizeOf(filterp), $FF);
  26. end;