OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [inet/] [rpc/] [clnt_udp.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* @(#)clnt_udp.c       2.2 88/08/01 4.0 RPCSRC */
2
/*
3
 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4
 * unrestricted use provided that this legend is included on all tape
5
 * media and as a part of the software program in whole or part.  Users
6
 * may copy or modify Sun RPC without charge, but are not authorized
7
 * to license or distribute it to anyone else except as part of a product or
8
 * program developed by the user.
9
 *
10
 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
12
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13
 *
14
 * Sun RPC is provided with no support and without any obligation on the
15
 * part of Sun Microsystems, Inc. to assist in its use, correction,
16
 * modification or enhancement.
17
 *
18
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20
 * OR ANY PART THEREOF.
21
 *
22
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
23
 * or profits or other special, indirect and consequential damages, even if
24
 * Sun has been advised of the possibility of such damages.
25
 *
26
 * Sun Microsystems, Inc.
27
 * 2550 Garcia Avenue
28
 * Mountain View, California  94043
29
 */
30
#if 0
31
static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
32
#endif
33
 
34
/*
35
 * clnt_udp.c, Implements a UDP/IP based, client side RPC.
36
 *
37
 * Copyright (C) 1984, Sun Microsystems, Inc.
38
 */
39
 
40
#define __FORCE_GLIBC
41
#include <features.h>
42
 
43
#include <stdio.h>
44
#include <unistd.h>
45
#include <rpc/rpc.h>
46
#include <rpc/xdr.h>
47
#include <rpc/clnt.h>
48
#include <sys/poll.h>
49
#include <sys/socket.h>
50
#include <sys/ioctl.h>
51
#include <netdb.h>
52
#include <errno.h>
53
#include <rpc/pmap_clnt.h>
54
#include <net/if.h>
55
#ifdef USE_IN_LIBIO
56
# include <wchar.h>
57
#endif
58
 
59
#ifdef IP_RECVERR
60
#include "errqueue.h"
61
#include <sys/uio.h>
62
#endif
63
 
64
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
65
extern u_long _create_xid (void);
66
 
67
/*
68
 * UDP bases client side rpc operations
69
 */
70
static enum clnt_stat clntudp_call (CLIENT *, u_long, xdrproc_t, caddr_t,
71
                                    xdrproc_t, caddr_t, struct timeval);
72
static void clntudp_abort (void);
73
static void clntudp_geterr (CLIENT *, struct rpc_err *);
74
static bool_t clntudp_freeres (CLIENT *, xdrproc_t, caddr_t);
75
static bool_t clntudp_control (CLIENT *, int, char *);
76
static void clntudp_destroy (CLIENT *);
77
 
78
static struct clnt_ops udp_ops =
79
{
80
  clntudp_call,
81
  clntudp_abort,
82
  clntudp_geterr,
83
  clntudp_freeres,
84
  clntudp_destroy,
85
  clntudp_control
86
};
87
 
88
/*
89
 * Private data kept per client handle
90
 */
91
struct cu_data
92
  {
93
    int cu_sock;
94
    bool_t cu_closeit;
95
    struct sockaddr_in cu_raddr;
96
    int cu_rlen;
97
    struct timeval cu_wait;
98
    struct timeval cu_total;
99
    struct rpc_err cu_error;
100
    XDR cu_outxdrs;
101
    u_int cu_xdrpos;
102
    u_int cu_sendsz;
103
    char *cu_outbuf;
104
    u_int cu_recvsz;
105
    char cu_inbuf[1];
106
  };
107
 
108
/*
109
 * Create a UDP based client handle.
110
 * If *sockp<0, *sockp is set to a newly created UPD socket.
111
 * If raddr->sin_port is 0 a binder on the remote machine
112
 * is consulted for the correct port number.
113
 * NB: It is the clients responsibility to close *sockp.
114
 * NB: The rpch->cl_auth is initialized to null authentication.
115
 *     Caller may wish to set this something more useful.
116
 *
117
 * wait is the amount of time used between retransmitting a call if
118
 * no response has been heard; retransmission occurs until the actual
119
 * rpc call times out.
120
 *
121
 * sendsz and recvsz are the maximum allowable packet sizes that can be
122
 * sent and received.
123
 */
124
CLIENT *
125
clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
126
                   struct timeval wait, int *sockp, u_int sendsz,
127
                   u_int recvsz)
128
{
129
  CLIENT *cl;
130
  struct cu_data *cu = NULL;
131
  struct rpc_msg call_msg;
132
 
133
  cl = (CLIENT *) mem_alloc (sizeof (CLIENT));
134
  sendsz = ((sendsz + 3) / 4) * 4;
135
  recvsz = ((recvsz + 3) / 4) * 4;
136
  cu = (struct cu_data *) mem_alloc (sizeof (*cu) + sendsz + recvsz);
137
  if (cl == NULL || cu == NULL)
138
    {
139
      struct rpc_createerr *ce = &get_rpc_createerr ();
140
#ifdef USE_IN_LIBIO
141
      if (_IO_fwide (stderr, 0) > 0)
142
        (void) __fwprintf (stderr, L"%s",
143
                           _("clntudp_create: out of memory\n"));
144
      else
145
#endif
146
        (void) fputs (_("clntudp_create: out of memory\n"), stderr);
147
      ce->cf_stat = RPC_SYSTEMERROR;
148
      ce->cf_error.re_errno = ENOMEM;
149
      goto fooy;
150
    }
151
  cu->cu_outbuf = &cu->cu_inbuf[recvsz];
152
 
153
  if (raddr->sin_port == 0)
154
    {
155
      u_short port;
156
      if ((port =
157
           pmap_getport (raddr, program, version, IPPROTO_UDP)) == 0)
158
        {
159
          goto fooy;
160
        }
161
      raddr->sin_port = htons (port);
162
    }
163
  cl->cl_ops = &udp_ops;
164
  cl->cl_private = (caddr_t) cu;
165
  cu->cu_raddr = *raddr;
166
  cu->cu_rlen = sizeof (cu->cu_raddr);
167
  cu->cu_wait = wait;
168
  cu->cu_total.tv_sec = -1;
169
  cu->cu_total.tv_usec = -1;
170
  cu->cu_sendsz = sendsz;
171
  cu->cu_recvsz = recvsz;
172
  call_msg.rm_xid = _create_xid ();
173
  call_msg.rm_direction = CALL;
174
  call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
175
  call_msg.rm_call.cb_prog = program;
176
  call_msg.rm_call.cb_vers = version;
177
  xdrmem_create (&(cu->cu_outxdrs), cu->cu_outbuf,
178
                 sendsz, XDR_ENCODE);
179
  if (!xdr_callhdr (&(cu->cu_outxdrs), &call_msg))
180
    {
181
      goto fooy;
182
    }
183
  cu->cu_xdrpos = XDR_GETPOS (&(cu->cu_outxdrs));
184
  if (*sockp < 0)
185
    {
186
      int dontblock = 1;
187
 
188
      *sockp = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
189
      if (*sockp < 0)
190
        {
191
          struct rpc_createerr *ce = &get_rpc_createerr ();
192
          ce->cf_stat = RPC_SYSTEMERROR;
193
          ce->cf_error.re_errno = errno;
194
          goto fooy;
195
        }
196
      /* attempt to bind to prov port */
197
      (void) bindresvport (*sockp, (struct sockaddr_in *) 0);
198
      /* the sockets rpc controls are non-blocking */
199
      (void) ioctl (*sockp, FIONBIO, (char *) &dontblock);
200
#ifdef IP_RECVERR
201
      {
202
        int on = 1;
203
        setsockopt(*sockp, SOL_IP, IP_RECVERR, &on, sizeof(on));
204
      }
205
#endif
206
      cu->cu_closeit = TRUE;
207
    }
208
  else
209
    {
210
      cu->cu_closeit = FALSE;
211
    }
212
  cu->cu_sock = *sockp;
213
  cl->cl_auth = authnone_create ();
214
  return cl;
215
fooy:
216
  if (cu)
217
    mem_free ((caddr_t) cu, sizeof (*cu) + sendsz + recvsz);
218
  if (cl)
219
    mem_free ((caddr_t) cl, sizeof (CLIENT));
220
  return (CLIENT *) NULL;
221
}
222
 
223
CLIENT *
224
clntudp_create (raddr, program, version, wait, sockp)
225
     struct sockaddr_in *raddr;
226
     u_long program;
227
     u_long version;
228
     struct timeval wait;
229
     int *sockp;
230
{
231
 
232
  return clntudp_bufcreate (raddr, program, version, wait, sockp,
233
                            UDPMSGSIZE, UDPMSGSIZE);
234
}
235
 
236
static int
237
is_network_up (int sock)
238
{
239
  struct ifconf ifc;
240
  char buf[UDPMSGSIZE];
241
  struct ifreq ifreq, *ifr;
242
  int n;
243
 
244
  ifc.ifc_len = sizeof (buf);
245
  ifc.ifc_buf = buf;
246
  if (ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0)
247
    {
248
      ifr = ifc.ifc_req;
249
      for (n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
250
        {
251
          ifreq = *ifr;
252
          if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
253
            break;
254
 
255
          if ((ifreq.ifr_flags & IFF_UP)
256
              && ifr->ifr_addr.sa_family == AF_INET)
257
            return 1;
258
        }
259
    }
260
  return 0;
261
}
262
 
263
static enum clnt_stat
264
clntudp_call (cl, proc, xargs, argsp, xresults, resultsp, utimeout)
265
     CLIENT *cl;        /* client handle */
266
     u_long proc;               /* procedure number */
267
     xdrproc_t xargs;           /* xdr routine for args */
268
     caddr_t argsp;             /* pointer to args */
269
     xdrproc_t xresults;        /* xdr routine for results */
270
     caddr_t resultsp;          /* pointer to results */
271
     struct timeval utimeout;   /* seconds to wait before giving up */
272
{
273
  struct cu_data *cu = (struct cu_data *) cl->cl_private;
274
  XDR *xdrs;
275
  int outlen = 0;
276
  int inlen;
277
  socklen_t fromlen;
278
  struct pollfd fd;
279
  int milliseconds = (cu->cu_wait.tv_sec * 1000) +
280
    (cu->cu_wait.tv_usec / 1000);
281
  struct sockaddr_in from;
282
  struct rpc_msg reply_msg;
283
  XDR reply_xdrs;
284
  struct timeval time_waited;
285
  bool_t ok;
286
  int nrefreshes = 2;           /* number of times to refresh cred */
287
  struct timeval timeout;
288
  int anyup;                    /* any network interface up */
289
 
290
  if (cu->cu_total.tv_usec == -1)
291
    {
292
      timeout = utimeout;       /* use supplied timeout */
293
    }
294
  else
295
    {
296
      timeout = cu->cu_total;   /* use default timeout */
297
    }
298
 
299
  time_waited.tv_sec = 0;
300
  time_waited.tv_usec = 0;
301
call_again:
302
  xdrs = &(cu->cu_outxdrs);
303
  if (xargs == NULL)
304
    goto get_reply;
305
  xdrs->x_op = XDR_ENCODE;
306
  XDR_SETPOS (xdrs, cu->cu_xdrpos);
307
  /*
308
   * the transaction is the first thing in the out buffer
309
   */
310
  (*(uint32_t *) (cu->cu_outbuf))++;
311
  if ((!XDR_PUTLONG (xdrs, (long *) &proc)) ||
312
      (!AUTH_MARSHALL (cl->cl_auth, xdrs)) ||
313
      (!(*xargs) (xdrs, argsp)))
314
    return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
315
  outlen = (int) XDR_GETPOS (xdrs);
316
 
317
send_again:
318
  if (sendto (cu->cu_sock, cu->cu_outbuf, outlen, 0,
319
              (struct sockaddr *) &(cu->cu_raddr), cu->cu_rlen)
320
      != outlen)
321
    {
322
      cu->cu_error.re_errno = errno;
323
      return (cu->cu_error.re_status = RPC_CANTSEND);
324
    }
325
 
326
  /*
327
   * Hack to provide rpc-based message passing
328
   */
329
  if (timeout.tv_sec == 0 && timeout.tv_usec == 0)
330
    {
331
      return (cu->cu_error.re_status = RPC_TIMEDOUT);
332
    }
333
 get_reply:
334
  /*
335
   * sub-optimal code appears here because we have
336
   * some clock time to spare while the packets are in flight.
337
   * (We assume that this is actually only executed once.)
338
   */
339
  reply_msg.acpted_rply.ar_verf = _null_auth;
340
  reply_msg.acpted_rply.ar_results.where = resultsp;
341
  reply_msg.acpted_rply.ar_results.proc = xresults;
342
  fd.fd = cu->cu_sock;
343
  fd.events = POLLIN;
344
  anyup = 0;
345
  for (;;)
346
    {
347
      switch (poll (&fd, 1, milliseconds))
348
        {
349
 
350
        case 0:
351
          if (anyup == 0)
352
            {
353
              anyup = is_network_up (cu->cu_sock);
354
              if (!anyup)
355
                return (cu->cu_error.re_status = RPC_CANTRECV);
356
            }
357
 
358
          time_waited.tv_sec += cu->cu_wait.tv_sec;
359
          time_waited.tv_usec += cu->cu_wait.tv_usec;
360
          while (time_waited.tv_usec >= 1000000)
361
            {
362
              time_waited.tv_sec++;
363
              time_waited.tv_usec -= 1000000;
364
            }
365
          if ((time_waited.tv_sec < timeout.tv_sec) ||
366
              ((time_waited.tv_sec == timeout.tv_sec) &&
367
               (time_waited.tv_usec < timeout.tv_usec)))
368
            goto send_again;
369
          return (cu->cu_error.re_status = RPC_TIMEDOUT);
370
 
371
          /*
372
           * buggy in other cases because time_waited is not being
373
           * updated.
374
           */
375
        case -1:
376
          if (errno == EINTR)
377
            continue;
378
          cu->cu_error.re_errno = errno;
379
          return (cu->cu_error.re_status = RPC_CANTRECV);
380
        }
381
#ifdef IP_RECVERR
382
      if (fd.revents & POLLERR)
383
        {
384
          struct msghdr msg;
385
          struct cmsghdr *cmsg;
386
          struct sock_extended_err *e;
387
          struct sockaddr_in err_addr;
388
          struct iovec iov;
389
          char *cbuf = (char *) alloca (outlen + 256);
390
          int ret;
391
 
392
          iov.iov_base = cbuf + 256;
393
          iov.iov_len = outlen;
394
          msg.msg_name = (void *) &err_addr;
395
          msg.msg_namelen = sizeof (err_addr);
396
          msg.msg_iov = &iov;
397
          msg.msg_iovlen = 1;
398
          msg.msg_flags = 0;
399
          msg.msg_control = cbuf;
400
          msg.msg_controllen = 256;
401
          ret = recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE);
402
          if (ret >= 0
403
              && memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0
404
              && (msg.msg_flags & MSG_ERRQUEUE)
405
              && ((msg.msg_namelen == 0
406
                   && ret >= 12)
407
                  || (msg.msg_namelen == sizeof (err_addr)
408
                      && err_addr.sin_family == AF_INET
409
                      && memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr,
410
                                 sizeof (err_addr.sin_addr)) == 0
411
                      && err_addr.sin_port == cu->cu_raddr.sin_port)))
412
            for (cmsg = CMSG_FIRSTHDR (&msg); cmsg;
413
                 cmsg = CMSG_NXTHDR (&msg, cmsg))
414
              if (cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_RECVERR)
415
                {
416
                  e = (struct sock_extended_err *) CMSG_DATA(cmsg);
417
                  cu->cu_error.re_errno = e->ee_errno;
418
                  return (cu->cu_error.re_status = RPC_CANTRECV);
419
                }
420
        }
421
#endif
422
      do
423
        {
424
          fromlen = sizeof (struct sockaddr);
425
          inlen = recvfrom (cu->cu_sock, cu->cu_inbuf,
426
                            (int) cu->cu_recvsz, 0,
427
                            (struct sockaddr *) &from, &fromlen);
428
        }
429
      while (inlen < 0 && errno == EINTR);
430
      if (inlen < 0)
431
        {
432
          if (errno == EWOULDBLOCK)
433
            continue;
434
          cu->cu_error.re_errno = errno;
435
          return (cu->cu_error.re_status = RPC_CANTRECV);
436
        }
437
      if (inlen < 4)
438
        continue;
439
 
440
      /* see if reply transaction id matches sent id.
441
        Don't do this if we only wait for a replay */
442
      if (xargs != NULL
443
          && (*((u_int32_t *) (cu->cu_inbuf))
444
              != *((u_int32_t *) (cu->cu_outbuf))))
445
        continue;
446
      /* we now assume we have the proper reply */
447
      break;
448
    }
449
 
450
  /*
451
   * now decode and validate the response
452
   */
453
  xdrmem_create (&reply_xdrs, cu->cu_inbuf, (u_int) inlen, XDR_DECODE);
454
  ok = xdr_replymsg (&reply_xdrs, &reply_msg);
455
  /* XDR_DESTROY(&reply_xdrs);  save a few cycles on noop destroy */
456
  if (ok)
457
    {
458
      _seterr_reply (&reply_msg, &(cu->cu_error));
459
      if (cu->cu_error.re_status == RPC_SUCCESS)
460
        {
461
          if (!AUTH_VALIDATE (cl->cl_auth,
462
                              &reply_msg.acpted_rply.ar_verf))
463
            {
464
              cu->cu_error.re_status = RPC_AUTHERROR;
465
              cu->cu_error.re_why = AUTH_INVALIDRESP;
466
            }
467
          if (reply_msg.acpted_rply.ar_verf.oa_base != NULL)
468
            {
469
              xdrs->x_op = XDR_FREE;
470
              (void) xdr_opaque_auth (xdrs,
471
                                      &(reply_msg.acpted_rply.ar_verf));
472
            }
473
        }                       /* end successful completion */
474
      else
475
        {
476
          /* maybe our credentials need to be refreshed ... */
477
          if (nrefreshes > 0 && AUTH_REFRESH (cl->cl_auth))
478
            {
479
              nrefreshes--;
480
              goto call_again;
481
            }
482
        }                       /* end of unsuccessful completion */
483
    }                           /* end of valid reply message */
484
  else
485
    {
486
      cu->cu_error.re_status = RPC_CANTDECODERES;
487
    }
488
  return cu->cu_error.re_status;
489
}
490
 
491
static void
492
clntudp_geterr (CLIENT *cl, struct rpc_err *errp)
493
{
494
  struct cu_data *cu = (struct cu_data *) cl->cl_private;
495
 
496
  *errp = cu->cu_error;
497
}
498
 
499
 
500
static bool_t
501
clntudp_freeres (CLIENT *cl, xdrproc_t xdr_res, caddr_t res_ptr)
502
{
503
  struct cu_data *cu = (struct cu_data *) cl->cl_private;
504
  XDR *xdrs = &(cu->cu_outxdrs);
505
 
506
  xdrs->x_op = XDR_FREE;
507
  return (*xdr_res) (xdrs, res_ptr);
508
}
509
 
510
static void
511
clntudp_abort (void)
512
{
513
}
514
 
515
static bool_t
516
clntudp_control (CLIENT *cl, int request, char *info)
517
{
518
  struct cu_data *cu = (struct cu_data *) cl->cl_private;
519
 
520
  switch (request)
521
    {
522
    case CLSET_FD_CLOSE:
523
      cu->cu_closeit = TRUE;
524
      break;
525
    case CLSET_FD_NCLOSE:
526
      cu->cu_closeit = FALSE;
527
      break;
528
    case CLSET_TIMEOUT:
529
      cu->cu_total = *(struct timeval *) info;
530
      break;
531
    case CLGET_TIMEOUT:
532
      *(struct timeval *) info = cu->cu_total;
533
      break;
534
    case CLSET_RETRY_TIMEOUT:
535
      cu->cu_wait = *(struct timeval *) info;
536
      break;
537
    case CLGET_RETRY_TIMEOUT:
538
      *(struct timeval *) info = cu->cu_wait;
539
      break;
540
    case CLGET_SERVER_ADDR:
541
      *(struct sockaddr_in *) info = cu->cu_raddr;
542
      break;
543
    case CLGET_FD:
544
      *(int *)info = cu->cu_sock;
545
      break;
546
    case CLGET_XID:
547
      /*
548
       * use the knowledge that xid is the
549
       * first element in the call structure *.
550
       * This will get the xid of the PREVIOUS call
551
       */
552
      *(u_long *)info = ntohl(*(u_long *)cu->cu_outbuf);
553
      break;
554
    case CLSET_XID:
555
      /* This will set the xid of the NEXT call */
556
      *(u_long *)cu->cu_outbuf =  htonl(*(u_long *)info - 1);
557
      /* decrement by 1 as clntudp_call() increments once */
558
    case CLGET_VERS:
559
      /*
560
       * This RELIES on the information that, in the call body,
561
       * the version number field is the fifth field from the
562
       * begining of the RPC header. MUST be changed if the
563
       * call_struct is changed
564
       */
565
      *(u_long *)info = ntohl(*(u_long *)(cu->cu_outbuf +
566
                                          4 * BYTES_PER_XDR_UNIT));
567
      break;
568
    case CLSET_VERS:
569
      *(u_long *)(cu->cu_outbuf + 4 * BYTES_PER_XDR_UNIT)
570
        = htonl(*(u_long *)info);
571
      break;
572
    case CLGET_PROG:
573
      /*
574
       * This RELIES on the information that, in the call body,
575
       * the program number field is the  field from the
576
       * begining of the RPC header. MUST be changed if the
577
       * call_struct is changed
578
       */
579
      *(u_long *)info = ntohl(*(u_long *)(cu->cu_outbuf +
580
                                          3 * BYTES_PER_XDR_UNIT));
581
      break;
582
    case CLSET_PROG:
583
      *(u_long *)(cu->cu_outbuf + 3 * BYTES_PER_XDR_UNIT)
584
        = htonl(*(u_long *)info);
585
      break;
586
    /* The following are only possible with TI-RPC */
587
    case CLGET_SVC_ADDR:
588
    case CLSET_SVC_ADDR:
589
    case CLSET_PUSH_TIMOD:
590
    case CLSET_POP_TIMOD:
591
    default:
592
      return FALSE;
593
    }
594
  return TRUE;
595
}
596
 
597
static void
598
clntudp_destroy (CLIENT *cl)
599
{
600
  struct cu_data *cu = (struct cu_data *) cl->cl_private;
601
 
602
  if (cu->cu_closeit)
603
    {
604
      (void) close (cu->cu_sock);
605
    }
606
  XDR_DESTROY (&(cu->cu_outxdrs));
607
  mem_free ((caddr_t) cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz));
608
  mem_free ((caddr_t) cl, sizeof (CLIENT));
609
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.