2 * m_pedit_udp.c packet editor: UDP header
4 * This program is free software; you can distribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Authors: J Hadi Salim (hadi@cyberus.ca)
18 #include <sys/socket.h>
19 #include <netinet/in.h>
20 #include <arpa/inet.h>
27 parse_udp(int *argc_p
, char ***argv_p
,
28 struct m_pedit_sel
*sel
, struct m_pedit_key
*tkey
)
32 char **argv
= *argv_p
;
40 tkey
->htype
= TCA_PEDIT_KEY_EX_HDR_TYPE_UDP
;
42 if (strcmp(*argv
, "sport") == 0) {
45 res
= parse_cmd(&argc
, &argv
, 2, TU32
, RU16
, sel
, tkey
);
49 if (strcmp(*argv
, "dport") == 0) {
52 res
= parse_cmd(&argc
, &argv
, 2, TU32
, RU16
, sel
, tkey
);
64 struct m_pedit_util p_pedit_udp
= {