source: branches/prototype-v0/zoo-project/zoo-kernel/sshapi.h @ 839

Last change on this file since 839 was 839, checked in by djay, 7 years ago

Update the source code for HPC support. Automatically adding nested outputs for the HPC support (should this be available for every support?). Add capability to store the metadata in the Collection DataBase?. Addition of the zcfg2sql to import any existing ZCFG file into the Collection DB. Add the support to invoke a callback (for history purpose) in case a [callback] section contains at least one parameter defined (url). Add support to convert maps and map to JSON (for callback use only by now). Fix some memory leaks (some are still there).

  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1/*
2 *
3 * Author : Gérald FENOY
4 *
5 *  Copyright 2017 GeoLabs SARL. All rights reserved.
6 *
7 * This work was supported by public funds received in the framework of GEOSUD,
8 * a project (ANR-10-EQPX-20) of the program "Investissements d'Avenir" managed
9 * by the French National Research Agency
10 *
11 * permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 * THE SOFTWARE.
28 */
29
30#ifndef SSHAPI_H
31#define SSHAPI_H 1
32
33#pragma once
34
35#include <libssh2.h>
36#include <libssh2_sftp.h>
37 
38#ifdef HAVE_WINSOCK2_H
39#include <winsock2.h>
40#endif
41#ifdef HAVE_SYS_SOCKET_H
42#include <sys/socket.h>
43#endif
44#ifdef HAVE_NETINET_IN_H
45#include <netinet/in.h>
46#endif
47#ifdef HAVE_SYS_SELECT_H
48#include <sys/select.h>
49#endif
50#ifdef HAVE_UNISTD_H
51#include <unistd.h>
52#endif
53#ifdef HAVE_ARPA_INET_H
54#include <arpa/inet.h>
55#endif
56#ifdef HAVE_SYS_TIME_H
57#include <sys/time.h>
58#endif
59 
60#include <arpa/inet.h>
61#include <sys/types.h>
62#include <fcntl.h>
63#include <errno.h>
64#include <stdio.h>
65#include <ctype.h>
66#include <time.h>
67
68#include "service.h"
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74#define MAX_PARALLEL_SSH_CON 128 
75
76  static int nb_sessions;
77
78  typedef struct {
79    int sock_id;
80    int index;
81    LIBSSH2_SESSION *session;
82    LIBSSH2_SFTP *sftp_session;
83  } SSHCON;
84
85 
86  ZOO_DLL_EXPORT SSHCON *ssh_connect(maps*);
87  ZOO_DLL_EXPORT bool ssh_copy(maps*,const char*,const char*,int);
88  ZOO_DLL_EXPORT int ssh_get_cnt(maps*);
89  ZOO_DLL_EXPORT int ssh_fetch(maps*,const char*,const char*,int);
90  ZOO_DLL_EXPORT int ssh_exec(maps*,const char*,int);
91  ZOO_DLL_EXPORT bool ssh_close_session(maps*,SSHCON*);
92  ZOO_DLL_EXPORT bool ssh_close(maps*);
93  ZOO_DLL_EXPORT bool addToUploadQueue(maps**,maps*);
94  ZOO_DLL_EXPORT bool runUpload(maps**);
95 
96#ifdef __cplusplus
97}
98#endif
99
100#endif
Note: See TracBrowser for help on using the repository browser.

Search

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png