yaig

yaig Commit Details


Date:2015-06-22 21:08:01 (9 years 5 months ago)
Author:Natalie Adams
Branch:master
Commit:120a432263155e31854301e7de9b3e752cb70610
Parents: 90ea3a8c5eba8a61595e34badde53fd85def39e9
Message:adding wildcard support

Changes:

File differences

yaig.py
3030
3131
3232
33
33
3434
3535
3636
......
9494
9595
9696
97
98
99
100
97101
98102
99103
......
108112
109113
110114
111
115
116
117
118
112119
113120
114121
......
127134
128135
129136
130
137
138
139
140
131141
132142
133143
NET_DIRECTION = enum("SERVER", "CLIENT")
FIREWALL_ACTION = enum("ACCEPT", "DROP", "REJECT")
NET_SOURCE = enum("ADDRESS", "GROUP")
TYPES = enum("GROUP", "ADDR", "PROTO")
TYPES = enum("GROUP", "ADDR", "PROTO", "WILDCARD")
class RuleStruct(Struct):
direction = None
returnlst.extend(getIPsInGroup(i.value))
elif i.object_type == TYPES.ADDR:
returnlst.append(object_defs[i.value])
elif i.object_type == TYPES.WILDCARD:
for obj in object_defs.iterkeys():
if obj.startswith(i.value):
returnlst.append(object_defs[obj])
return returnlst
try:
if CURRENT_STATE == PARSER_STATES.GLOBAL:
object_defs[parts[1]] = parts[2]
elif CURRENT_STATE == PARSER_STATES.GROUP_DEF:
group_defs[current_group].append(ObjectType(object_type=TYPES.ADDR, value=parts[1])) # initilize the dct on group entry...
if parts[1][len(parts[1]) - 1] == "+":
group_defs[current_group].append(ObjectType(object_type=TYPES.WILDCARD, value=parts[1].strip("+"))) # initilize the dct on group entry...
else:
group_defs[current_group].append(ObjectType(object_type=TYPES.ADDR, value=parts[1])) # initilize the dct on group entry...
elif parts[0] == "group":
if CURRENT_STATE == PARSER_STATES.GROUP_DEF:
group_defs[current_group].append(ObjectType(object_type=TYPES.GROUP, value=parts[1]))
if parts[1] == "group":
source = ObjectType(object_type=TYPES.GROUP, value=parts[2])
elif parts[1] == "object":
source = ObjectType(object_type=TYPES.ADDR, value=parts[2])
if parts[2][len(parts[2]) - 1] == "+":
source = ObjectType(object_type=TYPES.WILDCARD, value=parts[2].strip("+"))
else:
source = ObjectType(object_type=TYPES.ADDR, value=parts[2])
elif parts[1] == "proto":
source = ObjectType(object_type=TYPES.PROTO, value=parts[2])
if CURRENT_STATE == PARSER_STATES.GLOBAL:

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06556s using 14 queries.