def _unpack_actions(b, length, offset=0):
 if ((len(b) - offset) < length):
  raise UnderrunError
 actions = []
 end = (length + offset)
 while (offset < end):
  (t, l) = struct.unpack_from('!HH', b, offset)
  if ((len(b) - offset) < l):
   raise UnderrunError
  a = _action_type_to_class.get(t)
  if (a is None):
   a = ofp_action_generic()
  else:
   a = a()
  a.unpack(b[offset:(offset + l)])
  assert (len(a) == l)
  actions.append(a)
  offset += l
 return (offset, actions)

def _unpack_actions ( b , length , offset = 0 ) : if ( ( len ( b ) - offset ) < length ) : raise UnderrunError actions = [ ] end = ( length + offset ) while ( offset < end ) : ( t , l ) = struct . unpack_from ( '!HH' , b , offset ) if ( ( len ( b ) - offset ) < l ) : raise UnderrunError a = _action_type_to_class . get ( t ) if ( a is None ) : a = ofp_action_generic ( ) else : a = a ( ) a . unpack ( b [ offset : ( offset + l ) ] ) assert ( len ( a ) == l ) actions . append ( a ) offset += l return ( offset , actions )
parses actions from a buffer b is a buffer offset .