author | Dave Page <dave.page@gleeble.com> |
Thu, 26 Mar 2015 15:16:21 -0400 | |
changeset 2609 | 777d1a8b3a27 |
parent 2597 | 0e145bb05859 |
permissions | -rw-r--r-- |
2597
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
1 |
/***************************************************************************** |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
2 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
3 |
* $Id$ |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
4 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
5 |
* Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
6 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
7 |
* This file is part of the IgH EtherCAT Master. |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
8 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
9 |
* The IgH EtherCAT Master is free software; you can redistribute it and/or |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
10 |
* modify it under the terms of the GNU General Public License version 2, as |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
11 |
* published by the Free Software Foundation. |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
12 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
13 |
* The IgH EtherCAT Master is distributed in the hope that it will be useful, |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
16 |
* Public License for more details. |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
17 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
18 |
* You should have received a copy of the GNU General Public License along |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
19 |
* with the IgH EtherCAT Master; if not, write to the Free Software |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
20 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
21 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
22 |
* --- |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
23 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
24 |
* The license mentioned above concerns the source code only. Using the |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
25 |
* EtherCAT technology and brand is only permitted in compliance with the |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
26 |
* industrial property and similar rights of Beckhoff Automation GmbH. |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
27 |
* |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
28 |
****************************************************************************/ |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
29 |
|
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
30 |
#ifndef __COMMANDIP_H__ |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
31 |
#define __COMMANDIP_H__ |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
32 |
|
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
33 |
#include "Command.h" |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
34 |
|
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
35 |
/****************************************************************************/ |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
36 |
|
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
37 |
class CommandIp: |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
38 |
public Command |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
39 |
{ |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
40 |
public: |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
41 |
CommandIp(); |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
42 |
|
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
43 |
string helpString(const string &) const; |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
44 |
void execute(const StringVector &); |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
45 |
|
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
46 |
protected: |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
47 |
static void parseMac(unsigned char [6], const string &); |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
48 |
static void parseIpv4Prefix(ec_ioctl_slave_eoe_ip_t *, |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
49 |
const string &); |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
50 |
static void resolveIpv4(uint32_t *, const string &); |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
51 |
}; |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
52 |
|
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
53 |
/****************************************************************************/ |
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
54 |
|
0e145bb05859
Implemented EoE Set IP parameter request via command-line tool.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
55 |
#endif |