Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: third_party/twisted_8_1/twisted/runner/portmap.c

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2001-2004 Twisted Matrix Laboratories.
3 * See LICENSE for details.
4
5 *
6 */
7
8 /* portmap.c: A simple Python wrapper for pmap_set(3) and pmap_unset(3) */
9
10 #include <Python.h>
11 #include <rpc/rpc.h>
12 #include <rpc/pmap_clnt.h>
13
14 static PyObject * portmap_set(PyObject *self, PyObject *args)
15 {
16 unsigned long program, version;
17 int protocol;
18 unsigned short port;
19
20 if (!PyArg_ParseTuple(args, "llih:set",
21 &program, &version, &protocol, &port))
22 return NULL;
23
24 pmap_unset(program, version);
25 pmap_set(program, version, protocol, port);
26
27 Py_INCREF(Py_None);
28 return Py_None;
29 }
30
31 static PyObject * portmap_unset(PyObject *self, PyObject *args)
32 {
33 unsigned long program, version;
34
35 if (!PyArg_ParseTuple(args, "ll:unset",
36 &program, &version))
37 return NULL;
38
39 pmap_unset(program, version);
40
41 Py_INCREF(Py_None);
42 return Py_None;
43 }
44
45 static PyMethodDef PortmapMethods[] = {
46 {"set", portmap_set, METH_VARARGS,
47 "Set an entry in the portmapper."},
48 {"unset", portmap_unset, METH_VARARGS,
49 "Unset an entry in the portmapper."},
50 {NULL, NULL, 0, NULL}
51 };
52
53 void initportmap(void)
54 {
55 (void) Py_InitModule("portmap", PortmapMethods);
56 }
57
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/runner/inetdtap.py ('k') | third_party/twisted_8_1/twisted/runner/procmon.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698