Skip to content

Commit

Permalink
Update README, and add copyrights in pkt_lldp and pkt_mpls
Browse files Browse the repository at this point in the history
  • Loading branch information
shun159 committed Jul 18, 2016
1 parent a81fe92 commit 023f4c1
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Originally part of epcap:
Packet = [ Header | Payload ]
Header = #ether{} | #arp{} | #null{} | #linux_cooked{} |
#ipv4{} | #ipv6{} | #tcp{} | #udp{} | #sctp{} | #icmp{} |
#icmp6{} | #igmp{} | #gre{} | #llc{} | #vrrp{} | #'802.1q'{}
#icmp6{} | #igmp{} | #gre{} | #llc{} | #vrrp{} | #'802.1q'{} |
#lldp{} | #mpls{}
Payload = binary()

Convert network protocols from binary data to a list of Erlang
Expand All @@ -39,7 +40,8 @@ Originally part of epcap:
Headers = [Header]
Header = #ether{} | #arp{} | #null{} | #linux_cooked{} |
#ipv4{} | #ipv6{} | #tcp{} | #udp{} | #sctp{} | #icmp{} |
#icmp6{} | #igmp{} | #gre{} | #llc{} | #vrrp{} | #'802.1q'{}
#icmp6{} | #igmp{} | #gre{} | #llc{} | #vrrp{} | #'802.1q'{} |
#lldp{} | #mpls{}
SoFar = Headers | []
Payload = binary()

Expand All @@ -66,12 +68,15 @@ types.
icmp(Packet) -> {#icmp{}, Payload} | binary()
icmp6(Packet) -> {#icmp6{}, Payload} | binary()
igmp(Packet) -> {#igmp{}, Payload} | binary()
mpls(Packet) -> {#mpls{}, Next, Payload}
lldp(Packet) -> {#lldp{}, Payload}

Types Packet = Header | binary()
Header = #ether{} | #null{} | #linux_cooked{} | #arp{} |
#ipv4{} | #ipv6{} | #tcp{} | #sctp{} | #udp{} |
#icmp{} | #icmp6{} | #igmp{} | #gre{} | #llc{} |
#vrrp{} | #'802.1q'{}
#vrrp{} | #'802.1q'{} | #lldp{} | #mpls{}
Next = ipv4 | ipv6


makesum(Packet) -> integer()
Expand Down
30 changes: 30 additions & 0 deletions src/pkt_lldp.erl
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
%% Copyright (c) 2009-2015, 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
%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
%% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
%% POSSIBILITY OF SUCH DAMAGE.
-module(pkt_lldp).

-include("pkt_ether.hrl").
Expand Down
30 changes: 30 additions & 0 deletions src/pkt_mpls.erl
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
%% Copyright (c) 2009-2015, 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
%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
%% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
%% POSSIBILITY OF SUCH DAMAGE.
-module(pkt_mpls).

-include("pkt_mpls.hrl").
Expand Down

0 comments on commit 023f4c1

Please sign in to comment.