2003-07-15 07:07:13 +02:00
|
|
|
/*
|
2004-02-18 18:11:54 +01:00
|
|
|
* Copyright (c) 2003-2004 Stephen Williams (steve@icarus.com)
|
2003-07-15 07:07:13 +02:00
|
|
|
*
|
|
|
|
|
* This source code is free software; you can redistribute it
|
|
|
|
|
* and/or modify it in source code form under the terms of the GNU
|
|
|
|
|
* General Public License as published by the Free Software
|
|
|
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-08-29 03:41:23 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-07-15 07:07:13 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
# include "PUdp.h"
|
|
|
|
|
|
2004-02-18 18:11:54 +01:00
|
|
|
PUdp::PUdp(perm_string n, unsigned nports)
|
2003-07-15 07:07:13 +02:00
|
|
|
: ports(nports), sequential(false), initial(verinum::Vx), name_(n)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2004-03-08 01:47:44 +01:00
|
|
|
unsigned PUdp::find_port(const char*name)
|
|
|
|
|
{
|
2022-02-17 10:48:43 +01:00
|
|
|
for (unsigned idx = 0 ; idx < ports.size() ; idx += 1) {
|
2004-03-08 01:47:44 +01:00
|
|
|
|
|
|
|
|
if (ports[idx] == name)
|
|
|
|
|
return idx;
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-17 10:48:43 +01:00
|
|
|
return ports.size();
|
2004-03-08 01:47:44 +01:00
|
|
|
}
|
|
|
|
|
|