Permalink
Browse files

die trailing whitespace die!

  • Loading branch information...
1 parent 54b9db4 commit 4324dcf981942ee993e47aa5dcb0038ab4292589 @msantos committed Feb 19, 2010
Showing with 44 additions and 44 deletions.
  1. +5 −5 c_src/epcap.c
  2. +5 −5 c_src/epcap.h
  3. +5 −5 c_src/epcap_priv.c
  4. +9 −9 include/epcap_net.hrl
  5. +5 −5 src/epcap.erl
  6. +6 −6 src/epcap_net.erl
  7. +9 −9 src/sniff.erl
View
@@ -1,21 +1,21 @@
/* Copyright (c) 2009, Michael Santos <michael.santos@gmail.com>
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of the author nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
View
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2009, Michael Santos <michael.santos@gmail.com>
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of the author nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
View
@@ -1,21 +1,21 @@
/* Copyright (c) 2009, Michael Santos <michael.santos@gmail.com>
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of the author nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
View
@@ -2,8 +2,8 @@
-define(ETHTYPE_IPV4, 16#0800).
-define(ETHTYPE_IPV6, 16#86DD).
--define(IPPROTO_IP, 0).
--define(IPPROTO_ICMP, 1).
+-define(IPPROTO_IP, 0).
+-define(IPPROTO_ICMP, 1).
-define(IPPROTO_TCP, 6).
-define(IPPROTO_UDP, 17).
@@ -27,18 +27,18 @@
-record(ipv4, {
valid = false,
- v = 4, hl = 5, tos = 0, len = 20,
- id, df = 0, mf = 0,
+ v = 4, hl = 5, tos = 0, len = 20,
+ id, df = 0, mf = 0,
off = 0, ttl = 0, p = ?IPPROTO_TCP, sum = 0,
saddr = {127,0,0,1}, daddr = {127,0,0,1}
- }).
+ }).
-record(ipv6, {
valid = false,
- v = 6, class = 0, flow = 0,
+ v = 6, class = 0, flow = 0,
len = 40, next = 0, hop = 0,
saddr, daddr
- }).
+ }).
-record(tcp, {
valid = false,
@@ -49,12 +49,12 @@
psh = 0, rst = 0, syn = 0, fin = 0, win = 0,
sum, urp = 0,
opt = <<>>
- }).
+ }).
-record(udp, {
valid = false,
sport = 0, dport = 0, ulen = 0, sum = 0
- }).
+ }).
-record(icmp, {
valid,
View
@@ -1,21 +1,21 @@
%% Copyright (c) 2009, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
-%%
+%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
-%%
+%%
%% Redistributions of source code must retain the above copyright
%% notice, this list of conditions and the following disclaimer.
-%%
+%%
%% Redistributions in binary form must reproduce the above copyright
%% notice, this list of conditions and the following disclaimer in the
%% documentation and/or other materials provided with the distribution.
-%%
+%%
%% Neither the name of the author nor the names of its contributors
%% may be used to endorse or promote products derived from this software
%% without specific prior written permission.
-%%
+%%
%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
View
@@ -1,21 +1,21 @@
%% Copyright (c) 2009, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
-%%
+%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
-%%
+%%
%% Redistributions of source code must retain the above copyright
%% notice, this list of conditions and the following disclaimer.
-%%
+%%
%% Redistributions in binary form must reproduce the above copyright
%% notice, this list of conditions and the following disclaimer in the
%% documentation and/or other materials provided with the distribution.
-%%
+%%
%% Neither the name of the author nor the names of its contributors
%% may be used to endorse or promote products derived from this software
%% without specific prior written permission.
-%%
+%%
%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -107,7 +107,7 @@ ether(<<Dhost:6/bytes, Shost:6/bytes, Type:16, Payload/binary>>) ->
}, Payload}.
ipv4(
- <<4:4, HL:4, ToS:8, Len:16,
+ <<4:4, HL:4, ToS:8, Len:16,
Id:16, 0:1, DF:1, MF:1, %% RFC791 states it's a MUST
Off:13, TTL:8, P:8, Sum:16,
SA1:8, SA2:8, SA3:8, SA4:8,
View
@@ -1,21 +1,21 @@
%% Copyright (c) 2010, Michael Santos <michael.santos@gmail.com>
%% All rights reserved.
-%%
+%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
-%%
+%%
%% Redistributions of source code must retain the above copyright
%% notice, this list of conditions and the following disclaimer.
-%%
+%%
%% Redistributions in binary form must reproduce the above copyright
%% notice, this list of conditions and the following disclaimer in the
%% documentation and/or other materials provided with the distribution.
-%%
+%%
%% Neither the name of the author nor the names of its contributors
%% may be used to endorse or promote products derived from this software
%% without specific prior written permission.
-%%
+%%
%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -81,12 +81,12 @@ handle_info([{pkthdr, {{time, Time},{caplen, CapLen},{len, Len}}}, {packet, Pack
{caplen,CapLen},
{len,Len},
- % Source
+ % Source
{source_macaddr, string:join(epcap_net:ether_addr(Ether#ether.shost), ":")},
{source_address, IP#ipv4.saddr},
{source_port, port(sport, Hdr)},
- % Destination
+ % Destination
{destination_macaddr, string:join(epcap_net:ether_addr(Ether#ether.dhost), ":")},
{destination_address, IP#ipv4.daddr},
{destination_port, port(dport, Hdr)},
@@ -110,9 +110,9 @@ code_change(_OldVsn, State, _Extra) ->
{ok, State}.
-%%
+%%
%% Internal functions
-%%
+%%
timestamp(Now) when is_tuple(Now) ->
iso_8601_fmt(calendar:now_to_local_time(Now)).

0 comments on commit 4324dcf

Please sign in to comment.