#NEWLINE# def pack( self , negotiated = None ) : #NEWLINE# #INDENT# ordered_rules = [ ] #NEWLINE# for ID in sorted ( self . rules . keys ( ) ) : #NEWLINE# #INDENT# rules = self . rules [ ID ] #NEWLINE# for rule in rules : #NEWLINE# #INDENT# rule . operations &= ( CommonOperator . EOL ^ 255 ) #NEWLINE# #UNINDENT# rules [ ( - 1 ) ] . operations |= CommonOperator . EOL #NEWLINE# if ( ID not in ( FlowDestination . ID , FlowSource . ID ) ) : #NEWLINE# #INDENT# ordered_rules . append ( chr ( ID ) ) #NEWLINE# #UNINDENT# ordered_rules . append ( '' . join ( ( rule . pack ( ) for rule in rules ) ) ) #NEWLINE# #UNINDENT# components = ( self . rd . pack ( ) + '' . join ( ordered_rules ) ) #NEWLINE# l = len ( components ) #NEWLINE# if ( l < 240 ) : #NEWLINE# #INDENT# return ( '%s%s' % ( chr ( l ) , components ) ) #NEWLINE# #UNINDENT# if ( l < 4095 ) : #NEWLINE# #INDENT# return ( '%s%s' % ( pack ( '!H' , ( l | 61440 ) ) , components ) ) #NEWLINE# #UNINDENT# raise Notify ( 3 , 0 , 'my administrator attempted to announce a Flow Spec rule larger than encoding allows, protecting the innocent the only way I can' )