Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add defaults for records

Add defaults for the record keys for functions convertig records to
binaries.
  • Loading branch information...
commit a944075d5d48d2cea1c4d92ee78d774382f92dfc 1 parent f9441d2
@msantos authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 include/epcap_net.hrl
View
9 include/epcap_net.hrl
@@ -22,13 +22,16 @@
-define(ICMP_ADDRESSREPLY, 18).
-record(ether, {
- dhost, shost, type, crc
+ dhost = <<0,0,0,0,0,0>>,
+ shost = <<0,0,0,0,0,0>>,
+ type = ?ETH_P_IP,
+ crc = 0
}).
-record(ipv4, {
valid = false,
v = 4, hl = 5, tos = 0, len = 20,
- id, df = 0, mf = 0,
+ id = 0, df = 0, mf = 0,
off = 0, ttl = 0, p = ?IPPROTO_TCP, sum = 0,
saddr = {127,0,0,1}, daddr = {127,0,0,1}
}).
@@ -47,7 +50,7 @@
ackno = 0,
off = 0, cwr = 0, ece = 0, urg = 0, ack = 0,
psh = 0, rst = 0, syn = 0, fin = 0, win = 0,
- sum, urp = 0,
+ sum = 0, urp = 0,
opt = <<>>
}).
Please sign in to comment.
Something went wrong with that request. Please try again.