Index: trunk/ippTools/src/chiptool.c
===================================================================
--- trunk/ippTools/src/chiptool.c	(revision 9764)
+++ trunk/ippTools/src/chiptool.c	(revision 9765)
@@ -33,4 +33,7 @@
 static bool pendingimfileMode(pxConfig *config);
 static bool addprocessedimfileMode(pxConfig *config);
+static bool blockMode(pxConfig *config);
+static bool maskedMode(pxConfig *config);
+static bool unblockMode(pxConfig *config);
 static p2ProcessedImfileRow *p2PendingToProcessedImfile(pxConfig *config, p2PendingImfileRow *imfile);
 static p2ProcessedExpRow *p2PendingToProcessedExp(pxConfig *config, p2PendingExpRow *pendingExp);
@@ -51,8 +54,11 @@
 
     switch (config->mode) {
-        MODECASE(P2TOOL_MODE_QUICK, quickMode);
-        MODECASE(P2TOOL_MODE_DEFINE, defineMode);
+        MODECASE(P2TOOL_MODE_QUICK,                 quickMode);
+        MODECASE(P2TOOL_MODE_DEFINE,                defineMode);
         MODECASE(P2TOOL_MODE_PENDINGIMFILE,         pendingimfileMode);
         MODECASE(P2TOOL_MODE_ADDPROCESSEDIMFILE,    addprocessedimfileMode);
+        MODECASE(P2TOOL_MODE_BLOCK,                 blockMode);
+        MODECASE(P2TOOL_MODE_MASKED,                maskedMode);
+        MODECASE(P2TOOL_MODE_UNBLOCK,               unblockMode);
         default:
             psAbort(argv[0], "invalid option (this should not happen)");
@@ -385,4 +391,100 @@
     if (!psDBCommit(config->dbh)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
+        return false;
+    }
+
+    return true;
+}
+
+static bool blockMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    bool status = false;
+    psString label = psMetadataLookupStr(&status, config->args, "-label");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -label");
+        return false;
+    }
+    if (!label) {
+        psError(PS_ERR_UNKNOWN, true, "-label is required");
+        return false;
+    }
+
+    if (!p2MaskInsert(config->dbh, label)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        return false;
+    }
+
+    return true;
+}
+
+static bool maskedMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    psString query = psStringCopy("SELECT * FROM p2Mask");
+
+    if (!p_psDBRunQuery(config->dbh, query)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        psFree(query);
+        return false;
+    }
+    psFree(query);
+
+    psArray *output = p_psDBFetchResult(config->dbh);
+    if (!output) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        return false;
+    }
+    if (!psArrayLength(output)) {
+        // XXX check psError here
+        psError(PS_ERR_UNKNOWN, false, "no p2Mask rows found");
+        psFree(output);
+        return true;
+    }
+
+    bool simple = false;
+    {
+        bool status = false;
+        simple = psMetadataLookupBool(&status, config->args, "-simple");
+        if (!status) {
+            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");
+            return false;
+        }
+    }
+
+    // negative simple so the default is true
+    if (!ippdbPrintMetadatas(stdout, output, "p2Mask", !simple)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print array");
+        psFree(output);
+        return false;
+    }
+
+    psFree(output);
+
+    return true;
+}
+
+static bool unblockMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    bool status = false;
+    psString label = psMetadataLookupStr(&status, config->args, "-label");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -label");
+        return false;
+    }
+    if (!label) {
+        psError(PS_ERR_UNKNOWN, true, "-label is required");
+        return false;
+    }
+
+    char *query = "DELETE FROM p2Mask WHERE label = '%s'";
+
+    if (!p_psDBRunQuery(config->dbh, query, label)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        psFree(query);
         return false;
     }
Index: trunk/ippTools/src/chiptool.h
===================================================================
--- trunk/ippTools/src/chiptool.h	(revision 9764)
+++ trunk/ippTools/src/chiptool.h	(revision 9765)
@@ -28,5 +28,8 @@
     P2TOOL_MODE_DEFINE,
     P2TOOL_MODE_PENDINGIMFILE,
-    P2TOOL_MODE_ADDPROCESSEDIMFILE
+    P2TOOL_MODE_ADDPROCESSEDIMFILE,
+    P2TOOL_MODE_BLOCK,
+    P2TOOL_MODE_MASKED,
+    P2TOOL_MODE_UNBLOCK
 } p2toolMode;
 
Index: trunk/ippTools/src/chiptoolConfig.c
===================================================================
--- trunk/ippTools/src/chiptoolConfig.c	(revision 9764)
+++ trunk/ippTools/src/chiptoolConfig.c	(revision 9765)
@@ -83,4 +83,18 @@
             "define banana 2", NULL);
 
+    // -block
+    psMetadata *blockArgs = psMetadataAlloc();
+    psMetadataAddStr(blockArgs, PS_LIST_TAIL, "-label",  0,
+            "name of a label to mask out", NULL);
+    
+    // -masked
+    psMetadata *maskedArgs = psMetadataAlloc();
+    psMetadataAddBool(maskedArgs, PS_LIST_TAIL, "-simple",  0,
+            "use the simple output format", false);
+    
+    // -unblock
+    psMetadata *unblockArgs = psMetadataAlloc();
+    psMetadataAddStr(unblockArgs, PS_LIST_TAIL, "-label",  0,
+            "name of a label to unmask", NULL);
 
 #define PXTOOL_MODE(option, modeval, argset) \
@@ -107,4 +121,7 @@
     PXTOOL_MODE("-pendingimfile", P2TOOL_MODE_PENDINGIMFILE, pendingimfileArgs);
     PXTOOL_MODE("-addprocessedimfile",P2TOOL_MODE_ADDPROCESSEDIMFILE,addprocessedimfileArgs);
+    PXTOOL_MODE("-block",        P2TOOL_MODE_BLOCK,          blockArgs);
+    PXTOOL_MODE("-masked",       P2TOOL_MODE_MASKED,         maskedArgs);
+    PXTOOL_MODE("-unblock",      P2TOOL_MODE_UNBLOCK,        unblockArgs);
 
     bool argErr = false;
