def port_create_gre(br, port, id, remote):
 if (not (0 <= id < (2 ** 32))):
  return False
 elif (not __salt__['dig.check_ip'](remote)):
  return False
 elif (not bridge_exists(br)):
  return False
 elif (port in port_list(br)):
  cmd = 'ovs-vsctl set interface {0} type=gre options:remote_ip={1} options:key={2}'.format(port, remote, id)
  result = __salt__['cmd.run_all'](cmd)
  return _retcode_to_bool(result['retcode'])
 else:
  cmd = 'ovs-vsctl add-port {0} {1} -- set interface {1} type=gre options:remote_ip={2} options:key={3}'.format(br, port, remote, id)
  result = __salt__['cmd.run_all'](cmd)
  return _retcode_to_bool(result['retcode'])

def port_create_gre ( br , port , id , remote ) : if ( not ( 0 <= id < ( 2 ** 32 ) ) ) : return False elif ( not __salt__ [ 'dig.check_ip' ] ( remote ) ) : return False elif ( not bridge_exists ( br ) ) : return False elif ( port in port_list ( br ) ) : cmd = 'ovs-vsctl set interface {0} type=gre options:remote_ip={1} options:key={2}' . format ( port , remote , id ) result = __salt__ [ 'cmd.run_all' ] ( cmd ) return _retcode_to_bool ( result [ 'retcode' ] ) else : cmd = 'ovs-vsctl add-port {0} {1} -- set interface {1} type=gre options:remote_ip={2} options:key={3}' . format ( br , port , remote , id ) result = __salt__ [ 'cmd.run_all' ] ( cmd ) return _retcode_to_bool ( result [ 'retcode' ] )
generic routing encapsulation - creates gre tunnel between endpoints .